Re: Basic understanding and difference between getSuggestion and loopup method of InfixSuggester.

2013-09-05 Thread Ankit Murarka
Dear All, Can you please suggest me the possible difference between getSuggestion and InfixSuggester.lookup in terms of the suggestions provided by both of these. On 9/5/2013 1:04 PM, Ankit Murarka wrote: Hello All, I would like to know the basic difference between providing a phrase suggest

LookaheadTokenFilter

2013-09-05 Thread Benson Margulies
I'm trying to work through the logic of reading ahead until I've seen marker for the end of a sentence, then applying some analysis to all of the tokens of the sentence, and then changing some attributes of each token to reflect the results. The queue of tokens for a position is just a State, so t

Re: Lucene Concurrent Search

2013-09-05 Thread Stephen Green
You can implement a ServletListener for your app and open the index there (in the contextInitialized method). You can then create the SearcherManager from the IndexReader/Searcher and store it in the ServletContext, where it can be fetched out by your REST servlets. This is a typical pattern that

LookaheadTokenFilter

2013-09-05 Thread Benson Margulies
This useful-looking item is in the test-framework jar. Is there some subtle reason that it isn't in the common analyzer jar? Some reason why I'd regret using it?

Re: Lucene Concurrent Search

2013-09-05 Thread David Miranda
Did you have a practical example of the use of SearchManager (initialize, use to do research)? Thanks in advance. 2013/9/5 Stephen Green > You can implement a ServletListener for your app and open the index there > (in the contextInitialized method). You can then create the SearcherManager > f

Re: Lucene Concurrent Search

2013-09-05 Thread Ian Lea
I use a singleton class but there are other ways in tomcat. Can't remember what - maybe application scope. -- Ian. On Thu, Sep 5, 2013 at 4:46 PM, David Miranda wrote: > Where I can initialize the SearchManager variable to after use it in the > REST servlet to do research in the index? > > >

WordnetSynonymParser 4.4.0 which analyzer

2013-09-05 Thread Green Geometry
Hello all, I am trying to use WordnetSynonymParser in Lucene 4.4.0 to parse the WordNet prolog file. I need to pass an analyzer to the WordnetSynonymParser constructor. If I pass the StandardAnalyzer I get: Exception in thread "main" java.text.ParseException: Invalid synonym rule at line 109 at o

Re: Lucene Concurrent Search

2013-09-05 Thread David Miranda
Hi, I'm trying to implement my code with SearchManager to make my app thread-safe. I'm follow this post: http://blog.mikemccandless.com/2011/09/lucenes-searchermanager-simplifies.html There is a class that implements "SearchWarmer". I can't find this class in the Lucene library, what class is th

Re: Lucene Concurrent Search

2013-09-05 Thread David Miranda
Where I can initialize the SearchManager variable to after use it in the REST servlet to do research in the index? 2013/9/5 Ian Lea > I think that blog post was bleeding edge and the API changed a bit > subsequently. > > I use > > Directory dir = whatever; > SearcherManager sm = new SearcherMan

Re: Lucene Concurrent Search

2013-09-05 Thread Ian Lea
I think that blog post was bleeding edge and the API changed a bit subsequently. I use Directory dir = whatever; SearcherManager sm = new SearcherManager(dir, new SearcherFactory()); to get default behaviour. The javadocs for SearcherFactory explain that you can write your own implementation if

Re: Lucene handling of duplicate terms

2013-09-05 Thread Kristofer Karlsson
On Thu, Sep 5, 2013 at 3:40 PM, Toke Eskildsen wrote: > On Thu, 2013-09-05 at 09:28 +0200, Kristofer Karlsson wrote: > > For an example, I may have a million documents with just the term "foo" > in > > field A, and one particular document with the term "foo" in both field A > > and B, or have two

Re: Lucene handling of duplicate terms

2013-09-05 Thread Toke Eskildsen
On Thu, 2013-09-05 at 09:28 +0200, Kristofer Karlsson wrote: > For an example, I may have a million documents with just the term "foo" in > field A, and one particular document with the term "foo" in both field A > and B, or have two terms "foo" in the same field. > > If I search for "foo foo" I w

Re: Lucene Concurrent Search

2013-09-05 Thread Aditya
Hi You want to use REST service for your search, then my advice would be to use Solr. As it has buitl-in functionality of REST API. If you want to use Lucene then below are my comments: 1. In do search function, you are creating reader object. If this call is invoked for every query then it would

Re: Lucene handling of duplicate terms

2013-09-05 Thread Kristofer Karlsson
On Thu, Sep 5, 2013 at 9:46 AM, Adrien Grand wrote: > Hi, > > On Thu, Sep 5, 2013 at 9:28 AM, Kristofer Karlsson > wrote: > > I have a use case where some of my documents have duplicate terms in > > various fields or within the same field. > > > > For an example, I may have a million documents w

Re: Lucene handling of duplicate terms

2013-09-05 Thread Adrien Grand
Hi, On Thu, Sep 5, 2013 at 9:28 AM, Kristofer Karlsson wrote: > I have a use case where some of my documents have duplicate terms in > various fields or within the same field. > > For an example, I may have a million documents with just the term "foo" in > field A, and one particular document wit

Basic understanding and difference between getSuggestion and loopup method of InfixSuggester.

2013-09-05 Thread Ankit Murarka
Hello All, I would like to know the basic difference between providing a phrase suggestion based on String[] suggestionMatcher=getSuggestion(suggestedPhrase,phraseRecommender); and providing phrase suggestion based on : List list=ainfixSuggester.lookup(suggestedPhrase,false, 100); For the

Lucene handling of duplicate terms

2013-09-05 Thread Kristofer Karlsson
I have a use case where some of my documents have duplicate terms in various fields or within the same field. For an example, I may have a million documents with just the term "foo" in field A, and one particular document with the term "foo" in both field A and B, or have two terms "foo" in the sa

Re: Lucene Concurrent Search

2013-09-05 Thread Ian Lea
Take a look at org.apache.lucene.search.SearcherManager. >From the javadocs "Utility class to safely share IndexSearcher instances across multiple threads, while periodically reopening.". -- Ian. On Thu, Sep 5, 2013 at 2:16 AM, David Miranda wrote: > Hi, > > I'm developing a web application,