Searching ECommerceSearchDomains.Orders gives too few or too many hits

Question for a version that is passed End-Of-Life but hoping for the best:

Is the fuzzy search function disabled when searching from code? If so, is there any way to disable it programmatically?
Example:
I’m searching for all orders with status = WaitingConfirmation but I get hits where status = Confirmed. The enum OrderStatus states that WaitConfimation = 10 and Confirmed = 1?

And:
When querying the ECommerceSearchDomains.Orders, is there a cache or index involved that filters out hits other than the FilterTags I add from code? I don’t seem to get all expected hits…

Litium version: 4.7

Regards
Magnus

When you build your search query you will have a lot of different options to set that you can read here https://docs.litium.com/documentation/architecture/search

For example you can create an filter tag that will use a special analyser that not allows fuzzy searches

var term = "my search words";
request.FilterTags.Add(new Tag(FieldNames.Body, term) { Analyzer = "whitespace", AllowFuzzy = false, Boost = .08f });

All search is automatic adding permission tags that need to match. For the orders index you need to have access to the orders module in back office to be able to get the hits at all.

All the order status is indexed as the number for the current order state. The order state is configurable in the project so it is hard to say what the different numbers is in your solution.

If you not got the hits that you expect the reason can be that the search index not is updated yet or that the update of search index have failed. To check if that is the case you can login into back office, go to settings and search indexing and there rebuild the e-commerce search indexes.

I can’t find any information in Litium documentation (not in 4.7 or 6.x) regarding Analyzer except that Litium recommends three specific Analyzers for different situations?

Is it valid to only set the AllowFuzzy property of the Tag class? Will it work with any combination of Analyzer?

Regards
Magnus

The cause of the problem was a corrupt search index for e-commerce. This solved the problem with searches that did not get the expected hits.

Will investigate the AllowFuzzy setting more if that search still fails after rebuilding the search index.

Thanks for the answers! :slight_smile:
Magnus

1 Like

The search engine that Litium is using is Lucene.Net (version 3), you can find more information about Lucene.Net on https://lucenenet.apache.org

I think yes but not 100% sure, please check Lucene.Nets documentation to see if they write anything about that it not should work in any of the analyzer.