I have set-up a Azure Cognitive Search index with the 'Content and metadata' extract option in the indexer (content is extracted within the 'content' field of the index).
So far this has been working fine. But now I would like to search for documents containing a given string (so within the 'content' field) AND containing another string in the document name (stored in the 'metadata_storage_name'field).
I have tried many API requests but it is not satisfying so far, and I am getting lost in the Azure documentation...
Could anybody help?
Here is what I have tried to far:
- search=+6151654200 +Product Instructions_EN_&$count=true
- search=6151660260&$count=true&$filter=search.ismatch('Product Instructions_EN_')
- search=6151660260&$count=true&$filter=search.ismatch('Product Instructions_EN_', 'metadata_storage_name')
- search=6151660260&$searchFields=content&$count=true&$filter=search.ismatch('Product Instructions_EN_', 'metadata_storage_name')
- search=content:6151660260 AND metadata_storage_name:"Product Instructions_EN_"&$count=true&querytype=full
For instance I should get only one file in my index that fullfill the following condition:
metadata_storage_name
countains "Product Instructions_EN" ANDcontent
contains "6151656050"
Here is the targeted file metadata (except content
):
{
"metadata_storage_name": "ELB-ELS-ELC_Pistol_Product Instructions_EN_6159929240_EN-02-EN.PDF",
"metadata_storage_content_type": "application/pdf",
"metadata_storage_last_modified": "2020-12-14T15:32:08Z",
"metadata_storage_size": 2834713
"key": "aHR0cHM6Ly9hY3N0YXBhcHAwMDAwMDNjcGQuYmxvYi5jb3JlLndpbmRvd3MubmV0L2RvY3VtZW50YXRpb24tZmlsZXMvRUxCLUVMUy1FTENfUGlzdG9sX1Byb2R1Y3QlMjBJbnN0cnVjdGlvbnNfRU5fNjE1OTkyOTI0MF9FTi0wMi1FTi5QREY1"
}
Instead, I get a full list of multiple files and the one with the highest search score doesn't even contain Product "Instructions_EN"...
I have no specific anaylsers on the metadata_storage_name
metadata.
Thanks!