Hi,

I am a new user to Lucene Search

I want to index the contents of a file.
Contents of the file will be a single file name with extension (file name may 
contain special characters)
While indexing, I created a new analyzer to tokenize only on new line character.

Path of the file name is -> String Field with Store.YES
Contents of the file is -> TextField with a buffered input stream

Following is the view of the terms (using Luke)

[cid:image001.png@01CFD1C6.C3D8D150]

While searching for "7.txt", I need to get the 3 file paths containing the line 
'7.txt'.
Can anyone help me with the correct way to query this.

Using QueryParser with query string '7.txt' -> parsing it to contents:7 AND 
contents:txt

Analyzer analyzer = new NewLineAnalyzer (Version.LUCENE_4_9);

QueryParser parser = new QueryParser(Version.LUCENE_4_9, field, analyzer);

Following is always returning 0 matching documents

Query query = new QueryBuilder (analyzer).createBooleanQuery ("contents", 
queryString, BooleanClause.Occur.MUST);

Reply via email to