Hi,

I have problem with doing wild card search on file path fields.

i have a field "filePath" where i store complete path of files.

i have used StringField to store the field ("i assume by default
StringField will not be tokenized") .

doc.add(new StringField(FIELD_FILE_PATH,resourcePath, Store.YES));

I am using StandardAnalyzer for IndexWriter

but since i am using a StringField the fields are not analyzed.

After the files are indexed i checked it with Luke the path seems fine. And
when i do wildcard searches with luke i am getting desired results.

But when i do the same search in my code with IndexSearcher i am getting
zero docs

My searching code looks something like this

indexSearcher.search(new WildcardQuery(new
Term("filePath","*SuperClass.cls")),100);

this is returning zero documents.

But when i just use "*" in query it is returning all the documents

indexSearcher.search(new WildcardQuery(new Term("filePath","*")),100);

only when i use some queries like prefix wildcard etc it is not working

What is possibly going wrong.

Thanks,
Nischal Y

Reply via email to