FTS Query String for filters

Hi Guys,

We just start using FTS and trying to understand what are we doing wrong.

Please help!

Use case:
Get all entities where displayName(string) contains 172 and entity.workspaceId(number) is 102 or 103.

Query:
+displayName:“172” +workspaceId:103|102

Index config:

Hi Artur,

Few things caught attention here are,

Not very clear on the exact nature of the probable displayName field values here, especially in context of the contains requirement. For example, it could be in different formats - some172name, somename 172, somename172 etc.
As this is a text field, you may apply wildcard query on the displayName field to retrieve most of these value variations.

Second, I don’t think query string query has this options of OR-ing (|) values like mentioned above. FTS has a reasonable set of various query types to express your search criteria and query string query won’t be able to express all the other query combinations. Refer documentation for more details.

You could perhaps rewrite the query something like this.

{
  "query": {
    "conjuncts": [
      {
        "query": "+displayName:*172"
      },
      {
        "disjuncts": [
          {
            "query": "+workspaceId:102"
          },
          {
            "query": "+workspaceId:103"
          }
        ]
      }
    ]
  }
}```

Hi Sreekanth,

Thank you for your reply.
This is exactly what we were looking for!

I have a follow-up question.

Is there a possibility to return a legit json object when using “insert child mapping”?

Result from search:

  "fields": {
    "displayName": "04_GE_FASHION_034.jpg",
    "id": "78dc7bdb-8413-49b1-b93f-bb3575587de6",
    "previews.size135.s3Bucket": "devalex-globaledit-assets-previews",
    "previews.size135.s3Key": "100/101/78dc7bdb-8413-49b1-b93f-bb3575587de6_135.jpg",
    "workspaceId": 103
  }
}

Nice to have result:

  "fields": {
    "displayName": "04_GE_FASHION_034.jpg",
    "id": "78dc7bdb-8413-49b1-b93f-bb3575587de6",
    "previews": {
      "size135": {
        "s3Bucket": "devalex-globaledit-assets-previews",
        "s3Key": "100/101/9d3db9c7-dd57-4700-b3a7-998cf5e5b2ee_135.jpg"
      }
    },
    "workspaceId": 103
  }
}

Example of index settings:

Nope, FTS currently don’t have the option to return the json object as such as a part of the search result other than explicitly returning the stored field values along with the search results.
-Cheers!