I am probably misunderstanding somthing but I am a bit stuck on how to do this
What I have got is a field marked as I-S-----0--- inside luke I am trying to search this field using the queryparser as normal so my search is Field:mysearch but this never finds any results also if I right click in luke a term in the top ranking section for this field it also finds no results. But if I go to documents and browse by term and click show all docs it finds all the results.
I am using luke to test the index but I am also getting the same through code should I be doing somthing else with a non tokenized field? This field can't be tokenized it needs an exact match on it.
Can you show some pseudo-code? Because it is difficult to understand where you have mistakes.
This query returns 0 results
(Forename:(Zonder) OR Surname:(Zonder) OR NickName:(Zonder)) AND ObjectType:(Profile)
This query returns results
(Forename:(Zonder) OR Surname:(Zonder) OR NickName:(Zonder))
ObjectType is stored in the index but not tokenized.
If I perform a term lookup in luke on ObjectType = Profile it finds all the documents as it should.
If I perform a query search in luke with the first statment above it finds 0 results but the documents should match.
As I said I am probably missing somthing here as luke can locate the items through the document tab but it does have the issue I am getting on the query tab.
Forgot to mention I am actually using the .NET port for coding but in this both java and .net are giving same results
Here is my search code
objSearcher = new IndexSearcher(Directory, false);
QueryParser objParser = new QueryParser("", Analyzer);
Query objQuery = objParser.Parse(Criteria);
var objHits = objSearcher.Search(objQuery);
No. I mean show code where you create index and fulling data. By the way "new QueryParser("", Analyzer)" it means that you try to find empty fields. Of course Lucene will get result 0.
Sorry I misunderstood :)
Yes I know passing "" on parser isn't quite right as if I don't explicitly set the field then it has no default so it won't know what to search. With the queries I am using though I am always explicitly setting the field to search
Here is my indexing code
var objIndexWriter = new IndexWriter(Directory, Analyzer);
Document Creation happens multiple times it is read from a queue
var objDocument = new Document();
var objField = new NumericField("PartitionKey", 1, Field.Store.YES, false);
objField = new NumericField("RowKey", 1, Field.Store.YES, false);
objDocument.Add(new Field("ObjectType", Task.ObjectType, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
foreach (var objValue in Task.Values)
objDocument.Add(new Field(objValue.Key, objValue.Value, Field.Store.YES, Field.Index.ANALYZED));
Closing of the Index
Anyone with ideas I am a bit stuck :(