lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wangdong <hrdxwa...@gmail.com>
Subject Re: search on a field by a single word
Date Thu, 12 Feb 2015 01:46:24 GMT
thanks a lot for your answer

i find the second way may be useful to me. it is new to me and i will 
try it.

thanks
andrew

在 2015/2/11 21:39, Ian Lea 写道:
> If you only ever want to retrieve based on exact match you could index
> the name field using org.apache.lucene.document.StringField.  Do be
> aware that it is exact: if you do nothing else, a search for "a" will
> not match "A" or "A ".
>
> Or you could so something with start and end markers e.g. index your
> documents as something like "STARTMARKER a b c ENDMARKER" and search
> using a phrase or span query including the markers.
>
>
> --
> Ian.
>
>
>
> On Wed, Feb 11, 2015 at 7:55 AM, wangdong <hrdxwandg@gmail.com> wrote:
>> Hi folks
>>
>> I have a question as follows:
>>
>> suppose there are 3 document in field "name":
>> 1) a b c
>> 2) a b
>> 3) a
>>
>> I just want to retrival doc 3) only. I try to use syntax like this:
>> name:"a"
>> but I find it is not correct.is there any way to solve my question.
>>
>> please help me!
>> thanks ahead!
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>


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


Mime
View raw message