0
votes

Is there a way to limit azure cognitive search results based on a condition for e.g.: if content.length < 500:

I have several thousand pdf files indexed and many files are completely useless have less content. I don't want those files to show up in the search response.

I cannot delete them manually as these files are in large number.

Any help would be highly appreciated.

1

1 Answers

0
votes

If you're using a blob indexer to populate your search index you can add a new/additional index field and populate it with metadata_storage_size. Be sure that this "size" field is configured as filterable, and you should be able to use that field to filter out small PDFs.

https://docs.microsoft.com/en-us/azure/search/search-howto-indexing-azure-blob-storage#how-azure-cognitive-search-indexes-blobs

If you're populating the data in your search index manually, I think you'll still need a field to hold the document's size, and will need to populate it yourself.