You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by emmanuel Gosse <em...@gmail.com> on 2012/10/14 13:51:21 UTC
How could i take into account the other part of a field which not
matches with the query
>
> Hi,
> How could i take into account in a query the fact that the searched words
> could be more precise in a document field than an other.
>
example :
2 documents :
doc1 : title : taxi
doc2 : title : taxi driver
Query : TermQuery : title:taxi
How could doc1 has a better score than doc2 ?
That's a very basic example.
By rewriting a query, i have not enough lucene skills.
The way I think is more to use an other field with length or number of
words in title to use in a sort. (i don't use tf or idf in similarity).
> Best Regards
>
>
> E
Re: How could i take into account the other part of a field which not
matches with the query
Posted by Simon Willnauer <si...@gmail.com>.
hey.
On Sun, Oct 14, 2012 at 1:51 PM, emmanuel Gosse
<em...@gmail.com> wrote:
>>
>> Hi,
>
>
>
>> How could i take into account in a query the fact that the searched words
>> could be more precise in a document field than an other.
>>
>
> example :
> 2 documents :
> doc1 : title : taxi
> doc2 : title : taxi driver
>
> Query : TermQuery : title:taxi
>
> How could doc1 has a better score than doc2 ?
>
> That's a very basic example.
>
> By rewriting a query, i have not enough lucene skills.
> The way I think is more to use an other field with length or number of
> words in title to use in a sort. (i don't use tf or idf in similarity).
TF/IDF would score doc 1 better than doc 2 due to length
normalization. This seems like what you want to take into account. if
you really wanna go around similarity you can still use the norm value
that every field has (given you don't omit norms) and use it for
scroing. look into similarity how to decode / fetch norms.
simon
>
>
>> Best Regards
>>
>>
>> E
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org