RE: Search returning documents matching a NOT range

2010-11-05 Thread David Fertig
Ian, Thank you for getting back to me. No, I do not get a bogus hit from searching the small index alone. Also, I do not get a hit if I delete any more documents from the larger index. I have updated my test to use RamDirectory and also print maxDoc() for the searchables and the searcher, all

Re: Options for multiple filters

2010-11-05 Thread Ian Lea
What is your chosen version? At first glance I'd say your two examples should be the same but I know there is lots going on behind the scenes that I don't know about. Is one giving you correct results and the other not? As for BooleanFilter - no idea. FWIW I use QueryWrapperFilter, CachingWrapp

Re: Search returning documents matching a NOT range

2010-11-05 Thread Ian Lea
Do you get the bogus hit on the small index if search that index alone? Are you positive it only holds the one doc? Loading the one doc into a new RAM based index in the test would prove it. You are more likely to get help if post a self-contained example - people can see everything relevant and

Re: IndexWriter.close() performance issue

2010-11-05 Thread Michael McCandless
Hmm... So, I was going on this output from your CheckIndex: test: field norms.OK [296713 fields] But in fact I just looked and that number is bogus -- it's always equal to total number of fields, not number of fields with norms enabled. I'll open an issue to fix this, but in the mean

Re: IndexWriter.close() performance issue

2010-11-05 Thread Mark Kristensson
While most of our Lucene indexes are used for more traditional searching, this index in particular is used more like a reporting repository. Thus, we really do need to have that many fields indexed and they do need to be broken out into separate fields. There may be another way to structure the

Re: How index and search text files in Lucene 3.0.2 ?

2010-11-05 Thread Celso Fontes
thanks ! 2010/11/5 Uwe Schindler > Hi Celso, > > just a note, your code makes no sense: > > In the constructor of QueryParser you have to give the default field, e.g. > "content" only - With parse() you have to give the query string (which can > contain a field name or not): "computer" or altern

RE: How index and search text files in Lucene 3.0.2 ?

2010-11-05 Thread Uwe Schindler
Hi Celso, just a note, your code makes no sense: In the constructor of QueryParser you have to give the default field, e.g. "content" only - With parse() you have to give the query string (which can contain a field name or not): "computer" or alternatively "content:computer" (which returns equal

Re: How index and search text files in Lucene 3.0.2 ?

2010-11-05 Thread Celso Fontes
Thanks Uwe, its works with: QueryParser parser = new QueryParser(Version.LUCENE_30, "content:computer", analyzer); Query query = parser.parse("content:computer"); But, if i need get results like google in a query like "What is the role of PrnP in mad cow disease?" Thanks

RE: RangeQuery with multiple ranges ?

2010-11-05 Thread Uwe Schindler
Why do you use such complicated stuff to build the BQ? Term term1 = new Term(LuceneIndexField.SCALE, "1"); Term term2 = new Term(LuceneIndexField.SCALE, "5"); BooleanQuery bq = new BooleanQuery(); bq.add(new RangeQuery(term1, term1, true), BooleanClause.Occur.SHOULD); bq.add(new RangeQuer

RE: RangeQuery with multiple ranges ?

2010-11-05 Thread David Fertig
You can use a query parser to parse your text query into the appropriate query objects. -Original Message- From: Alain Camus [mailto:a...@ngi.be] Sent: Friday, November 5, 2010 11:26 AM To: java-user@lucene.apache.org Subject: RangeQuery with multiple ranges ? Hello list, I'm new to l

RangeQuery with multiple ranges ?

2010-11-05 Thread Alain Camus
Hello list, I'm new to lucene, trying to find out if this is possible : In Luke, I can write a query that gets me the results I want, that is : +denominator:([1 TO 1] OR [2 TO 2]) I'd like to write the same in java. I tried the next code but it doesn't work : BooleanClause.O

Re: High frequency term for the searched query

2010-11-05 Thread starz10de
HI Mike, I implemented MoreLikeThis but I couldn't figure out where or how to print the related term to the given query. All what I got is the relevant documents to the query with their scores. Any idea how to get the related terms? -- View this message in context: http://lucene.472066.n3.nab

Re: Question about custom Analyzer

2010-11-05 Thread heikki
thanks ! With your fast response we've been able to get it to work. Kind regards Heikki Doeleman On Thu, Nov 4, 2010 at 11:01 AM, Uwe Schindler wrote: > The problem with your implementatio n of reuseableTokenStream is that it > does not set a new reader when it reuses. Reset() is the wrong m

RE: High frequency term for the searched query

2010-11-05 Thread starz10de
Hi, I did as it is explained in the website: final Set terms = new HashSet(); query = searcher.rewrite(query); query.extractTerms(terms); for(Term t : terms){ int frequency = searcher.docFreq(t); } however I can't understa

Re: High frequency term for the searched query

2010-11-05 Thread Michael McCandless
Maybe MoreLikeThisQuery (under contrib/queries) will do what you want? Mike On Fri, Nov 5, 2010 at 3:33 AM, starz10de wrote: > > Hi, > > I need to expand the query with the most terms occurred with it in > documents. For example:  the word credits, tax, withdraw have high appearing > with Bank.

RE: High frequency term for the searched query

2010-11-05 Thread Uwe Schindler
It's there: http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/search/Query. html#extractTerms(java.util.Set) - Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: starz10de [mailto:farag_ah...@y

Re: High frequency term for the searched query

2010-11-05 Thread starz10de
HI Chris, I tried your solution and got one problem "the method extractterms(Set) is undefined for the type Query" this is the ocde: Query query = QueryParser.parse(line, "contents", analyzer); //System.out.println("Searching for: " + query.toString("contents")); Hits hits = s

RE: How index and search text files in Lucene 3.0.2 ?

2010-11-05 Thread Uwe Schindler
The default field of query parser is wrong: QueryParser parser = new QueryParser(Version.LUCENE_30, "computer", analyzer); You haven't indexed a field with name "computer". Your query string does not override the field, so your query is in fact "computer:computer". A note: It is not recommended t

RE: High frequency term for the searched query

2010-11-05 Thread starz10de
Hi, I need to expand the query with the most terms occurred with it in documents. For example: the word credits, tax, withdraw have high appearing with Bank. So my query is “Bank” and the result should be ranked list of the most frequent terms with "Bank" I could do that as I explained but not