Lucene shows parts of search query as a HIT

2007-07-18 Thread Askar Zaidi
Hey folks, I am a new Lucene user , I used the following after indexing: search(searcher, "W. Chan Kim"); Lucene showed me hits of documents where "channel" word existed. Notice that "Chan" is a part of "Channel" . How do I stop this ? I am keen to find the exact word. I used the following, b

Re: Lucene shows parts of search query as a HIT

2007-07-18 Thread Erick Erickson
Are you sure that the hit wasn't on "w" or "kim"? The default for searching is OR... I recommend that you get a copy of Luke (google lucene luke) which allows you to examine your index as well as see how queries parse using various analyzers. It's an invaluable tool... Best Erick On 7/18/07, As

Re: Lucene shows parts of search query as a HIT

2007-07-18 Thread Askar Zaidi
Hey Guys, I just checked my Lucene results. It shows a document with the word hit "change" when I am searching for "Chan", and it considers that as a hit. Is there a way to stop this and show just the exact word match ? I started using Lucene yesterday, so I am fairly new ! thanks AZ On 7/18/0

RE: Lucene shows parts of search query as a HIT

2007-07-19 Thread Ard Schrijvers
Hello Askar, Which analyzer are you using for indexing and searching? If you use an analyzer that uses stemming, you might see that "change", "changing", "changed", "chan" etc al get reduced to the same word "chan". In luke you can test with plugins that show you what tokens are created from y

Re: Lucene shows parts of search query as a HIT

2007-07-19 Thread Erick Erickson
You say there's only one document and you added many. The line IndexWriter writer = new IndexWriter(indexPath, new StandardAnalyzer(), true); blows away any existing index data and starts over. If you're calling this fragment for each document, you'll always have only one doc. Try changing the '

Re: Lucene shows parts of search query as a HIT

2007-07-19 Thread Askar Zaidi
Yes, I realized that. Now I have all the documents in the Index. I'll play around with Luke to see what can stop stemming. thanks ! AZ On 7/19/07, Erick Erickson <[EMAIL PROTECTED]> wrote: You say there's only one document and you added many. The line IndexWriter writer = new IndexWriter(ind

Re: Lucene shows parts of search query as a HIT

2007-07-19 Thread Askar Zaidi
Hey Erik, How can I change the default Lucene OR property to AND. When I tried query.toString(), I got contents:w contents:chan contents: kim Thats fine, but its doing OR, how can I make it AND so that it shows: contents: W Chan Kim ?? thanks a ton ! AZ On 7/19/07, Erick Erickson <[EMAIL P

Re: Lucene shows parts of search query as a HIT

2007-07-19 Thread Erick Erickson
QueryParser.setDefaultOperator On 7/19/07, Askar Zaidi <[EMAIL PROTECTED]> wrote: Hey Erik, How can I change the default Lucene OR property to AND. When I tried query.toString(), I got contents:w contents:chan contents: kim Thats fine, but its doing OR, how can I make it AND so that it show

Re: Lucene shows parts of search query as a HIT

2007-07-20 Thread Askar Zaidi
Hey guys, Thanks for all the response. One more thing, I am accessing my documents like this: for (int i = 0; i < hitCount; i++) { Document doc = hits.doc(i); System.out.println(" " + (i + 1) + ". " + doc.get("item")); } This shows me the item value.

RE: Lucene shows parts of search query as a HIT

2007-07-20 Thread Ard Schrijvers
Hello, hits.score(i) See http://lucene.zones.apache.org:8080/hudson/job/Lucene-Nightly/javadoc/org/apache/lucene/search/Hits.html Ard > Hey guys, > > Thanks for all the response. One more thing, I am accessing > my documents > like this: > > for (int i = 0; i < hitCount; i++) { >