Are there any issues with indexing and searching for document properties with negative numeric values?
It seems like we have a problem where we don’t find e.g. pages using the Lucene search when looking for negative page property values (e.g. -123). If the value is positive it works as expected.
Steps to reproduce:
Create a numerical pagetype property
Publish a page where the numerical page property has a negative value, e.g. -123
Run a search like:
var q = new QueryRequest(languageId, SearchDomains.Pages, SecurityToken.AnonymousToken);
var c = new MandatoryTagClause();
c.Tags.Add(new Tag(TagNames.GetTagNameForProperty("foo"), -123));
q.FilterTags.Add(c);
var r = Solution.Instance.SearchService.Search(q);
// r.TotalHitCount => 0
var query = new QueryRequest(webSite.Language.ID, SearchDomains.Pages, _token);
var range = new RangeTag(TagNames.GetTagNameForProperty("foo"), -123, -123);
query.FilterTags.Add(range);
var response = Solution.Instance.SearchService.Search(query);
(tested on version 6.2 but should also work fine in version 4.8)
Thanks, that’s a workaround I guess
(We “solved it” by padding the indexed values with a string prefix and treating the value as a string, which worked in this case.)