Doesn it make sense cache IndexReader?

2008-07-16 Thread Mohsen Saboorian
Hi, I have a set of indices in different languages (very smal indices: on average each index directory has 10,000 documents, which has an overall size of less than 2mb). I want to know if this is a good idea to cache IndexReader (once opened) somewhere and further reuse it? My application is singl

Re: Doesn it make sense cache IndexReader?

2008-07-17 Thread Mohsen Saboorian
Kastern, thanks for the reply. > IndexReader is thread-save so you don't need a cache. If it wasn't thread-safe I may need a cache? I think the cache cannot be used on a non-thread-safe environment since it exposes same instances to different threads. > Opening and closing an IndexReader takes

Highlighter doesn't highlight wildcard queries after updating to 2.9.1/3.0.0

2009-12-30 Thread Mohsen Saboorian
After updating to 2.9.x or 3.0, highlighter doesn't work on wildcard queries like "abc*". I thought that it would be because of scoring, so I also set myIndexSearcher.setDefaultFieldSortScoring(true, true) before searching. I tested with both QueryScorer and QueryTermScorer. In my custom highligh

Re: Highlighter doesn't highlight wildcard queries after updating to 2.9.1/3.0.0

2009-12-30 Thread Mohsen Saboorian
ld", new StringReader("text to search in")); String resultStr = highlighter.getBestFragments(tokenStream, "text to search in", 100, "..."); Mohsen markrmiller wrote: > > Mohsen Saboorian wrote: >> After updating to 2.9.x or 3.0, highlighter doesn't

Re: Highlighter doesn't highlight wildcard queries after updating to 2.9.1/3.0.0

2010-01-10 Thread Mohsen Saboorian
panTerm is extracted. It this a bug? Thanks, Mohsen Mohsen Saboorian wrote: > > Yes I can (though I need some time, since I have my nested custom > analyzers and filter). I'll try to write a test scenario to reproduce this > issue. > > For now, can you tell me if these st

Re: Highlighter doesn't highlight wildcard queries after updating to 2.9.1/3.0.0

2010-01-10 Thread Mohsen Saboorian
ymore like Lucene 2.3, and returns nothings renderable, I stopped rewriting and to my surprise, highlighter worked with prefix, or other queries. It was also needed to add lucene-memory contrib library (which is referenced by WeightedSpanTermExtractor) to prevent exception (NCDFE). Mohsen Mohsen

Re: Highlighter doesn't highlight wildcard queries after updating to 2.9.1/3.0.0

2010-01-11 Thread Mohsen Saboorian
wildcard queries (as before). Mohsen Mohsen Saboorian wrote: > > OK, to answer my own question: > I found from the following issue that if I do a query.rewrite(), > highlighter doesn't work. > https://issues.apache.org/jira/browse/LUCENE-1425 > > I did rewrite() in order

Matched Query Part in Hit Object

2007-03-24 Thread Mohsen Saboorian
Hi, Is there a way to find the matched part of query string in the Hit object? Lucene's Hilghlighter module does part of the job, highlighting the matched word in the result document, however it doesn't give the effective keyword in query string. For example, suppose I have a query: "lorem OR elit

Re: Matched Query Part in Hit Object

2007-03-26 Thread Mohsen Saboorian
Any hint? Mohsen Saboorian wrote: > > Hi, > Is there a way to find the matched part of query string in the Hit object? > Lucene's Hilghlighter module does part of the job, highlighting the > matched word in the result document, however it doesn't give the effective

Emulating Pages Search

2007-03-31 Thread Mohsen Saboorian
Hi, Is there a way to do emulate paged search in Lucene? I can use the following peace of code for returning the first page (10 items in each page), but don't know how to navigate to the next page :-) IndexSearcher is = new ... ... TopFieldDocs tops = is.search(query, null

Re: Emulating Pages Search

2007-04-01 Thread Mohsen Saboorian
This is possible, but the problem here is performance. Why is it not possible to support pagination in a more efficient way? Suppose, a Searcher looks through Documents and find the matching ones. Theoretically, it can stop searching when the result hit number gets more than a threshold. Searcher

Error-Tolerant

2007-04-03 Thread Mohsen Saboorian
-- View this message in context: http://www.nabble.com/Error-Tolerant-tf3524057.html#a9831495 Sent from the Lucene - Java Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional co

Error Tolerant Query Parser

2007-04-03 Thread Mohsen Saboorian
Sorry for dual posting. I've just inadvertently submit form before writing the body :) Is there any error tolerant query parser ever written for Lucene? What is the way websites use for advanced searching with Lucene? -- View this message in context: http://www.nabble.com/Error-Tolerant-tf35240

Re: Error Tolerant Query Parser

2007-04-04 Thread Mohsen Saboorian
. . . . . . . > Simpy -- http://www.simpy.com/ - Tag - Search - Share > > - Original Message > From: Mohsen Saboorian <[EMAIL PROTECTED]> > To: java-user@lucene.apache.org > Sent: Wednesday, April 4, 2007 2:05:02 AM > Subject: Error Tolerant Query Parser &

Leading and trailing wildcard together

2007-04-21 Thread Mohsen Saboorian
Hi, I've noticed that from Lucene 2.1 leading wildcard can be enabled using QueryParser.setAllowLeadingWildcard(true), however I wasn't able to search for *Foo* (while "?Foo*" and even "?*Foo*" works). Is it possible to have leading and trailing star wildcard together? Thanks. -- View this messa

User Defined Matcher

2007-07-13 Thread Mohsen Saboorian
Is it possible that I inject my own matching mechanism into Lucene IndexSearcher? In other words, is this possible that my own method be called in order to collect results (hits)? Suppose the case that I want to match - for example - "foo" with both "foo" and "oof". Thanks in advance, Mohsen. --

Re: User Defined Matcher

2007-07-13 Thread Mohsen Saboorian
Thanks for quick replies. Mathieu Lecarme wrote: > > Uses synonyms in the query parser > Sorry, I didn't get the point of synonym. Can you explain more? -- View this message in context: http://www.nabble.com/User-Defined-Matcher-tf4075337.html#a11583698 Sent from the Lucene - Java Users mai