Create a Post
Title
Details
0
Query "conversion"
I'm trying to take the following simple query and "convert" it to a full text query via the $searchBeta aggregation operator: { DeskId: 1 } Here's the aggregation I created instead: [ { "$searchBeta": { "index": "Test1", "search": { "query": 1, "path": "DeskId" } } } ] The original query returns many documents from the collection but the aggregation returns none. If it helps here's the index definition: { "analyzer": "lucene.standard", "searchAnalyzer": "lucene.standard", "mappings": { "dynamic": false, "fields": { "DeskId": { "analyzer": "lucene.keyword", "type": "string" }, "IPTCMetadata": { "fields": { "Byline": { "analyzer": "lucene.simple", "type": "string" }, "BylineTitleId": { "analyzer": "lucene.keyword", "type": "string" }, "Category": { "analyzer": "lucene.keyword", "type": "string" }, "Description": { "analyzer": "lucene.standard", "type": "string" }, "JobId": { "analyzer": "lucene.keyword", "type": "string" }, "Source": { "analyzer": "lucene.keyword", "type": "string" }, "SupplementalCategories": { "analyzer": "lucene.keyword", "type": "string" }, "Title": { "analyzer": "lucene.standard", "type": "string" } }, "type": "document" }, "PhotoState": { "analyzer": "lucene.keyword", "type": "string" }, "Routing": { "analyzer": "lucene.keyword", "type": "string" }, "SearchType": { "analyzer": "lucene.keyword", "type": "string" }, "WasCaptionAdded": { "analyzer": "lucene.keyword", "type": "string" }, "WasCaptionCorrected": { "analyzer": "lucene.keyword", "type": "string" }, "WasKilled": { "analyzer": "lucene.keyword", "type": "string" } } } } Note that the DeskId field is an integer in the Mongo collection but is a string in the search index. I'm not sure if this is necessary but it didn't look like there is "integer" type available.
1
Load More