Results 1 to 2 of 2
Thread: Regex approach
- 11-02-2009, 02:24 PM #1
Member
- Join Date
- Nov 2009
- Posts
- 1
- Rep Power
- 0
Regex approach
Hi, all,
I couldn't find an answer on my question in Internet for several days. May be I can't to formulate a correct query into google.
Let's get to the point...
Usual scenario when Lucene can be used is following:
1) The system indexes documents content
2) User searches documents using phrases
3) Lucene returns documents which contains input phrases
Problem area:
Can Lucene be used for the scenario when:
1) system indexes phrases,
2) user provides a Text
3) Lucene returns all indexed phrases which text includes
for example,
Indexed phrases: "like", "kids", "table". User inputs: "I like children and kids". Lucene returns: "like", "kids".
Because of big number (~14000) of phrases Regex approach does not work.
Please, let me know if this scenario can be implemented using Lucene.
- 11-04-2009, 05:53 PM #2
Member
- Join Date
- Oct 2008
- Location
- US
- Posts
- 58
- Rep Power
- 0
I think this is a common problem while searching I would suggest you try something like this
1. store the phrases in a field in index.
2. This may require you to store many phrases per document.
3. Also store a field with document location so that you can point to the document link for search result.
4. Also store line numbers in index for each phrase, this way you can point your user directly to a specific line number if needed.
Doing the same regex approach on a index on phrases would fetch you more relevant results then doing it on a full document content.
Let me know if you have some questions.
Njoy,
LuceneHave fun....
JAVA FAQs
Similar Threads
-
Please suggest me the correct approach!
By rjuyal in forum Advanced JavaReplies: 6Last Post: 05-05-2008, 02:54 PM -
Opinions on best approach for objects
By spikey in forum Advanced JavaReplies: 1Last Post: 04-11-2008, 05:20 PM -
Checking ResultSet (second approach)
By Java Tip in forum Java TipReplies: 0Last Post: 02-09-2008, 08:39 PM -
Best Jsp book with practical approach
By Saurabh321 in forum New To JavaReplies: 0Last Post: 02-05-2008, 08:12 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks