Why does this search succeed with web app, but not Luke?

2009-08-06 Thread ohaya
Hi, In my indexer app (based on the IndexFiles.java demo), I am adding the "path" field: doc.add(new Field("path", f.getPath(), Field.Store.YES, Field.Index.ANALYZED)); Per Luke, the full path (e.g., "c:\\.yyy") gets parsed, and one of the terms (again, per Luke) is "", i.e.,

Re: Why does this search succeed with web app, but not Luke?

2009-08-06 Thread Phil Whelan
Hi Jim, Are you using the same Analyzer for indexing and searching? .yyy will be seem as a HOSTNAME by StandardAnalyzer and will keep it as one term, whereas another indexer might split this into 2 terms. This should not matter either way as long as you are using the same Analyzer for both ind

Re: Why does this search succeed with web app, but not Luke?

2009-08-06 Thread ohaya
Phil, Both my indexer and the webapp are basically from the Lucene demos, the indexer starting with the IndexFiles.java demo code, so I think they're both using the StandardAnalyzer. What appears in Luke, when I select "path" is just the filename part, without the extension, i.e., the "" p

Re: Why does this search succeed with web app, but not Luke?

2009-08-06 Thread ohaya
Phil, I need to be more precise... The files that I have are at, say: C:\dir1\dir2\ so, for example, I have C:\dir1\dir2\file-1-1.dat C:\dir1\dir2\file-1-2.dat C:\dir1\dir2\file-1-3.dat C:\dir1\dir2\file-1-4.dat C:\dir1\dir2\file-1-5.dat After indexing, and, using Luke, I look at the "path" f

Re: Why does this search succeed with web app, but not Luke?

2009-08-06 Thread Phil Whelan
Hi Jim, > As I said, based on the terms in Luke, I would have expected a web app query > on: > > path:file-1-2 > > to succeed, and a query on: > > path:file-1-2.dat > to fail. > > But, instead both of those succeed when I do a web query. This query will also pass through the same (hopefully) Ana

Re: Why does this search succeed with web app, but not Luke?

2009-08-06 Thread ohaya
Hi Phil, Well, kind of... but... Then, why, when I do the search in Luke, do I get the results I cited: ==> succeeds .yyy ==> fails (no results) I guess that I've been assuming that the search in Luke is "correct" and I've been using that to "test my understanding", but maybe that'

Re: Why does this search succeed with web app, but not Luke?

2009-08-07 Thread Ian Lea
It is a good general assumption that Luke is correct. Can you confirm that you are using StandardAnalyzer everywhere, for indexing and searching? This sort of issue is often caused by using different analyzers. What does Luke show as the indexed terms for path? In a little index I've just creat

Re: Why does this search succeed with web app, but not Luke?

2009-08-07 Thread Andrzej Bialecki
oh...@cox.net wrote: Hi Phil, Well, kind of... but... Then, why, when I do the search in Luke, do I get the results I cited: ==> succeeds .yyy ==> fails (no results) I guess that I've been assuming that the search in Luke is "correct" and I've been using that to "test my understa

Re: Why does this search succeed with web app, but not Luke?

2009-08-07 Thread Matthew Hall
Luke defaults to KeywordAnalyzer when you do a search on it. You have to specifically choose StandardAnalyzer. You are probably already doing this, but I figure its worth a check. Matt Andrzej Bialecki wrote: oh...@cox.net wrote: Hi Phil, Well, kind of... but... Then, why, when I do the

Re: Why does this search succeed with web app, but not Luke?

2009-08-07 Thread ohaya
Ian, I just re-confirmed that StandardAnalyzer is used in both my indexer app and in the query/search web app. The actual file paths look like: C:\lucene-devel\dat\.dat or C:\lucene-devel\data\testdir\\.dat For field "path", Luke shows: lucene data c devel dat

Re: Why does this search succeed with web app, but not Luke?

2009-08-07 Thread ohaya
Andrzej, Hah! I tried as you suggested using Luke, and I found at least part of my problem. Luke was defaulting to KeywordAnalyzer. I changed that to StandardAnalyzer, and did queries for: path:x and path:xx.dat For the first, the Rewritten was:

Re: Why does this search succeed with web app, but not Luke?

2009-08-07 Thread ohaya
Hi Matt, Good catch! As I just posted, I *just* noticed that (Luke use Keyword Analyzer) :)!!! Once I switched Luke to using Standard Analyzer, the Luke search results matched my web query results. Thanks! Jim Matthew Hall wrote: > Luke defaults to KeywordAnalyzer when you do a sea