lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Newbie Question on - Multi valued Keyword field search
Date Sat, 13 Dec 2008 08:57:00 GMT
Have a look at Lucene's BoostingTermQuery, which uses payloads.  There  
is a unit test example also.

	Erik

On Dec 13, 2008, at 3:22 AM, ayyanar wrote:

>
> Hi Eric,
>
> I need to set the high boost for the value "Dirty" in the document 3  
> since i
> want the document 3 to come first. This is not field based boost  
> since there
> are multiple values in the keyword field of a document. Iam aware we  
> can do
> this by using payload concept, but i dont know how to do and there  
> are no
> examples in the net.
>
> Please not that i will search only in the keyword field and i need  
> to do the
> index time boosting.
>
> Thanks,
> Ayyanar
>
>
> Erik Hatcher wrote:
>>
>> What criteria defines that #3 comes first?   There's lots of ways of
>> shifting documents around in the search results, boosting by field
>> (indexing or query time), boosting by document (index time),  
>> elevation
>> (a Solr feature), etc.
>>
>> 	Erik
>>
>> On Dec 13, 2008, at 12:20 AM, ayyanar wrote:
>>
>>>
>>> Let's say that I have 3 documents with a field "name" and a
>>> multivalued field
>>> "keywords":
>>>
>>> Document 1:
>>>
>>> Name = Dog
>>> Keywords = Cool, Big, Dirty
>>>
>>> Document 2:
>>>
>>> Name = Cat
>>> Keywords = Small, Dirty
>>>
>>> Document 3:
>>>
>>> Name = Fish
>>> Keywords = Smells, Dirty
>>>
>>> If I search the keyword "Dirty", then I need to get all the
>>> documents with
>>> the keyword "Dirty". But I want document 3 to come first. Iam aware
>>> we can
>>> set the boost for the keyword "Dirty", and we can go for the  
>>> following
>>> concepts:
>>>
>>> 1) Storing multiple times the boosted keyword
>>> 2) Using payload
>>>
>>> Iam not sure on how to write the code for the payload concept since
>>> there is
>>> no good example code available in the net. You can help me on two
>>> things:
>>>
>>> 1) Suggesting some other good approach
>>> 2) Providing me the payload code example.
>>>
>>> Thanks in advance
>>> Ayyanar
>>>
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/Newbie-Question-on---Multi-valued-Keyword-field-search-tp20987615p20987615.html
>>> Sent from the Lucene - General mailing list archive at Nabble.com.
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/Newbie-Question-on---Multi-valued-Keyword-field-search-tp20987615p20988263.html
> Sent from the Lucene - General mailing list archive at Nabble.com.


Mime
View raw message