So, just to confirm, using Lucene 4.0, we would be able to issue a search on 
one or more fields and would be able to get the results sorted by a custom 
field and also would be able to get the score of each document based on the 
frequency of the terms searched in all the indexed fields of that document 
(rather than getting it scored just by the fields in the query, which is the 
case now).

If this is true, could be please guide me into the direction on how to 
implement it?

Thanks a lot for your help.

-Siraj
(212) 306-0154

-----Original Message-----
From: Simon Willnauer [mailto:simon.willna...@gmail.com]
Sent: Tuesday, October 23, 2012 3:51 AM
To: java-user@lucene.apache.org
Subject: Re: Scoring based on document

hey there,


in Lucene 4 you can override the termStatistics / CollectionStatistics used for 
scoring in the IndexSearcher. You can take multiple fields into account here in 
order use it for scoring. Here is the javadoc
link:

http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/search/IndexSearcher.html#termStatistics(org.apache.lucene.index.Term,
org.apache.lucene.index.TermContext)
http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/search/IndexSearcher.html#collectionStatistics(java.lang.String)


simon
On Mon, Oct 22, 2012 at 11:25 PM, Siraj Haider <si...@jobdiva.com> wrote:
> I am using DefaultSimilarity and did not boost any field while indexing. My 
> index is comprised of the following fields:
>
> -          Title
>
> -          Author
>
> -          Bookname
>
> -          Description
>
> All of the 4 fields are indexed and can be searched on by the user. Now let's 
> say the user searches for "oracle" in Title field, the score is computed 
> based on the Title field only, and its disregarding the frequency of the term 
> "oracle" in other fields. It might be like that by design but I need to 
> change it so that the documents are ranked based on the frequency in the 
> whole document and not based on the field searches. Please help!
>
> Thanks in advance
> -Siraj
>
>
> ________________________________
> This electronic mail message and any attachments may contain information 
> which is privileged, sensitive and/or otherwise exempt from disclosure under 
> applicable law. The information is intended only for the use of the 
> individual or entity named as the addressee above. If you are not the 
> intended recipient, you are hereby notified that any disclosure, copying, 
> distribution (electronic or otherwise) or forwarding of, or the taking of any 
> action in reliance on, the contents of this transmission is strictly 
> prohibited. If you have received this electronic transmission in error, 
> please notify us by telephone, facsimile, or e-mail as noted above to arrange 
> for the return of any electronic mail or attachments. Thank You.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org


This electronic mail message and any attachments may contain information which 
is privileged, sensitive and/or otherwise exempt from disclosure under 
applicable law. The information is intended only for the use of the individual 
or entity named as the addressee above. If you are not the intended recipient, 
you are hereby notified that any disclosure, copying, distribution (electronic 
or otherwise) or forwarding of, or the taking of any action in reliance on, the 
contents of this transmission is strictly prohibited. If you have received this 
electronic transmission in error, please notify us by telephone, facsimile, or 
e-mail as noted above to arrange for the return of any electronic mail or 
attachments. Thank You.

Reply via email to