Since DeliveryTargetCodes is an array of strings, you’ll need to index it as a child field.
Also, since the content has special characters and you’re searching for them as is - I would recommend using the “keyword” analyzer for it.
I’m facing some trouble in writing the search query using .NET API. I’ve three questions (stated below).
Implement GreaterThan in Datetime ( LastUpdatedOn >= “2020-08-01”)
new DateRangeQuery().Start(DateTime.Parse(“2020-08-01”), true).Field(“LastUpdatedOn”) → Throws an error on execution
Match a number to an Id
new MatchQuery(“67”).Field(“Topics.Id”) → Not working when i pass a number as string
IN clause implementation (DeliveryTargetCodes IN (‘web3__sections__international_asia’ , ‘web3__sections__citywire_global’ ))
new MatchPhraseQuery(“web3__sections__international_asia”).Field(“DeliveryTargetCodes”),
new MatchPhraseQuery(“web3__sections__citywire_global”).Field(“DeliveryTargetCodes”),
If both the matchphrasequery is added, it becomes an AND, I’m looking for OR implementation.
I’ve included curl/http request examples, the documentation should help you build these queries in the right syntax for the SDKs.
For the greater than date range query, you’ll first need to index LastUpdatedOn as a “datetime” field. All formats compliant to ISO-8601 are accepted. Now your date time range query should resemble …
Next, match queries work on text only. So if “id” were indexed as a numeric field in the index definition, you would need to use a numeric range query even to do a point look up.
To replicate the “IN” clause behavior, you’ll need to do a disjunction over 2 match queries - which effectively will get you the OR behavior you’re looking for …