Hi <@U01PL2YSG8L>, sorry for the delay. Here's the...
# community-help
k
Hi @Kishore Nallan, sorry for the delay. Here's the code. In the first search it searches by text_stem field as normally, in the 2nd search it ignores it. Although in both cases there is an exact match.
Copy code
# Create a collection
curl -X POST "<http://localhost:8108/collections>" \
  -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "test",
    "fields": [
      {
        "name": "text_stem",
        "type": "string",
        "stem": true
      },
      {
        "name": "text",
        "type": "string"
      }
    ]
  }'

# Add a document to the collection
curl -X POST "<http://localhost:8108/collections/test/documents>" \
  -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "1",
    "text": "subscription",
    "text_stem": "subscription"
  }'

# Perform a multi-search
curl -X POST "<http://localhost:8108/multi_search>" \
  -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "searches": [
      {
        "q": "subscription",
        "collection": "test",
        "query_by": "text_stem"
      },
      {
        "q": "subscription",
        "collection": "test",
        "query_by": "text,text_stem"
      }
    ]
  }'