Hi
I am using ElasticSearch and FSCrawler together. I have indexed a document directory with default of FSCrawler settings, no template applied no filter applied. simple standard configuration only.
I have a simple query
I want to search some text on documents but i would like retrieve result which match my criteria for fullFilePath i.e. UNC Path, I can see there is a property path.real, but that property is case sensitive. In my case i want path.real case insensitive. I am using windows environment.
My object was to search some text only in specified/given file(s). filepath should be case insensitive.
Feeing source.path.real or MyDoc.path.real is case sensitive, I am able to get result when filter matches with case sensitivity but the same below query didn't return result if filter is not matched with case sensitivity.
I think it is executing the query first then it is assigning the value of MyDoc.path.real.
overall my motto was either to search something in given file only or search something and then filter the fullfilepath as per my input,
var testResults = client.Search<MyDoc>(selector => selector
.Query(q => q
.Bool(b => b
.Should(s => s
.Match(m => m
.Field(f => f.content)
.Query(query.ToLower()) //this is my local variable
)
)
.Filter(fi => fi
.Match(r => r
.Field(f => f.path.real)
.Query(fullFilePath.ToLower()) //this is my local variable
)
)
)
)
);
I am using NEST client, so i would prefer answer which compatible with NEST Client.
Below if my default mapping for doing indexing on documents.
{"MyDoc":{"mappings":{"dynamic_templates":[{"raw_as_text":{"path_match":"meta.raw.*","mapping":{"fields":{"keyword":{"ignore_above":256,"type":"keyword"}},"type":"text"}}}],"properties":{"attachment":{"type":"binary"},"attributes":{"properties":{"group":{"type":"keyword"},"owner":{"type":"keyword"},"permissions":{"type":"long"}}},"content":{"type":"text"},"file":{"properties":{"checksum":{"type":"keyword"},"content_type":{"type":"keyword"},"created":{"type":"date","format":"dateOptionalTime"},"extension":{"type":"keyword"},"filename":{"type":"keyword","store":true},"filesize":{"type":"long"},"indexed_chars":{"type":"long"},"indexing_date":{"type":"date","format":"dateOptionalTime"},"last_accessed":{"type":"date","format":"dateOptionalTime"},"last_modified":{"type":"date","format":"dateOptionalTime"},"url":{"type":"keyword","index":false}}},"meta":{"properties":{"altitude":{"type":"text"},"author":{"type":"text"},"comments":{"type":"text"},"contributor":{"type":"text"},"coverage":{"type":"text"},"created":{"type":"date","format":"dateOptionalTime"},"creator_tool":{"type":"keyword"},"date":{"type":"date","format":"dateOptionalTime"},"description":{"type":"text"},"format":{"type":"text"},"identifier":{"type":"text"},"keywords":{"type":"text"},"language":{"type":"keyword"},"latitude":{"type":"text"},"longitude":{"type":"text"},"metadata_date":{"type":"date","format":"dateOptionalTime"},"modifier":{"type":"text"},"print_date":{"type":"date","format":"dateOptionalTime"},"publisher":{"type":"text"},"rating":{"type":"byte"},"raw":{"properties":{"Content-Encoding":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"Content-Type":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"X-Parsed-By":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"resourceName":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}}},"relation":{"type":"text"},"rights":{"type":"text"},"source":{"type":"text"},"title":{"type":"text"},"type":{"type":"text"}}},"path":{"properties":{"real":{"type":"keyword","fields":{"fulltext":{"type":"text"},"tree":{"type":"text","analyzer":"fscrawler_path","fielddata":true}}},"root":{"type":"keyword"},"virtual":{"type":"keyword","fields":{"fulltext":{"type":"text"},"tree":{"type":"text","analyzer":"fscrawler_path","fielddata":true}}}}}}}}}