0
votes

I have configured my Azure Search for the Database as well as a Container in a Storage Account with Blobs. The single word Search works fine across the data sources. And also, multiple word search with logical operators works fine in the context of a single Blob. But, its not giving me desired result, as my Search needs to work in the context of collection of blobs.

I have a database object to which multiple documents are attached (stored as blob in different folders under a Container). My search (with multiple words and logical operators) needs to show the User the business object in case it hits the condition valid for multiple documents attached to the business object.

So, I have a business object "A" with documents "B", "C" and "D" attached, stored in the folder "E" under a Container (for which Indexer has been created in my Azure Search). Document B has word "king" and C has word "queen" in it. In this scenario, if I search "king + queen" then it doesn't give my any result. I would like to get "A" in my search result, as collectively, it satisfies the "king + queen" condition.

1

1 Answers

1
votes

Boolean operators in Azure Search queries work on individual document level. In your example, querying “king + queen” would search for documents that contain both “king” and “queen” – read more here about simple query syntax.

If you have other identifying criteria for business object "A" (like a name or an object-id field), you can construct a query to capture that, and use a logical "OR" to list the keywords, e.g. – "A + (king | queen)" when using queryType=simple (which is the default). You may also consider using the queryType=full mode for a more expressive query language where you could also express expected values of individual fields (like "name:A"). For further reading, see Lucene query syntax in Azure Search.