lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "anshum.gupta@naukri.com" <ansh...@gmail.com>
Subject Re: Problem searching in the same sentence
Date Thu, 16 Sep 2010 17:45:51 GMT
Try with multi valued field while indexing i.e. Add each sentence as a separate field(with
the same field name) to the same document. This would give you the results as you want.

------Original Message------
From: Sirish Vadala
To: java-user@lucene.apache.org
ReplyTo: java-user@lucene.apache.org
Subject: Problem searching in the same sentence
Sent: Sep 16, 2010 23:09


Hello All: 

Can any one suggest me the best way to allow me to perform a sentence
specific phrase search? 

Eg: Let the indexed text be: 

If you are posting a question, please try search first. Your question may
have already been answered. Don't post repeatedly. Wait for a few days.
People will read your post by email.

Now if I search for the phrase 'post repeatedly Wait for a few', still I am
able to retrieve the document even though they are in different sentences.

Currently I am using StandardAnalyzer and this is how I am generating lucene
documents:

Field field = new Field(fieldName, validFieldValue, Field.Store.YES,
Field.Index.ANALYZED);
document.add(field);

Is there a way to keep track of different sentences while indexing the
content.
Any hint would be appreciated. 
Thanks. 
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Problem-searching-in-the-same-sentence-tp1501269p1501269.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

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



--
Anshum
http://blog.anshumgupta.net

Sent from BlackBerry®
Mime
View raw message