hkf
hkf

Reputation: 4520

AWS CloudSearch Filter on non-indexed field

I'm trying to do a structured query with a lot of dynamic fields (potentially) in the search pattern. So far everything is good, except I want to be able to limit from the result by field that is not indexed. Is this possible?

The test search console is showing this error: "Syntax Error in query: field (fieldname) is not searchable"

Upvotes: 1

Views: 716

Answers (2)

Chad Schwab
Chad Schwab

Reputation: 1

I figured this out by checking out the Cloudsearch console network payload.

If you are filtering by a facet field that is not marked searchable, you have to add a second query parameter: fq=<facetFieldName>&facet.<facetFieldName>={}. This seems to filter the results as expected.

Upvotes: 0

nanestev
nanestev

Reputation: 872

All index fields that you intend to use for filtering should be marked as searchable:

enter image description here

Upvotes: 1

Related Questions