Jan 9, 2014 at 11:17 AM
Edited Jan 9, 2014 at 11:18 AM
I've just run into an issue where Orchard indexes my data but I can't query it due to case differences. For example, if I have 3 Content Types: TypeOne, TypeTwo, and TypeThree they are indexed thus:
Orchard's implementation of ISearchBuilder.WithField(string, string) converts any query terms ToLower() and ISearchBuilder.Parse() does the same due to the behavior of Lucene StandardAnalyzer.
Using Luke, the Lucene query tool, I've deduced that case is the issue.
Search string "type:TypeOne" becomes "type:typeone" and returns 0 documents even if there are documents of TypeOne in the index.
Search string "type:/TypeOne/" and search string "type:TypeOne*" remain unchanged and return the TypeOne and TypeTwo documents in the index.
Since I can't get a case-insensitive query, is there a way to change the analyzer or index the "type" field differently?
ContentType's are indexed without analysis or tokenization so their case is kept in the index. This is done at at Orchard.Web\Core\Common\Handlers\CommonPartHandler.cs:53 thus:
How do I construct a query for Content Type using the Orchard.Search framework, given the fact that (at least in this case) all queries are lower-case, but this field is case-sensative?
Please help and thanks!