Not all fields are indexed

I indexed several raw json documents using BulkRequest index BinaryData from json string.

If I run a match all query, I am getting back all my documents. However only certain fields are searchable. Why aren't all fields searchable

{
    "took": 60,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 67,
            "relation": "eq"
        },
        "max_score": 1.0,
        "hits": [
            {
                "_index": "i-f827034e-a38f-3ea7-9a70-4a049a099de3",
                "_id": "BNyhR4oBYMuzxnj8uZ8M",
                "_score": 1.0,
                "_source": {
                    "id": "224903",
                    "category": "Person",
                    "Service Provider": "Commonwealth Trust Limited",
                    "CompanyType": "Standard Company under IBC Act",
                    "Latitude": "18.420695",
                    "Country Code": "VGB;HKG",
                    "Jurisdiction": "XXX",
                    "Status": "Active",
                    "Address": "Panocean Secretarial Services Limited Room 1708 Kai Tak Commercial Building 317-321 Des Voeux Road C Hong Kong RT BVI",
                    "Incorporation Date": "05-JAN-2005",
                    "Name": "Zipmatic Limited",
                    "Jursidiction Description": "Undetermined",
                    "Countries": "British Virgin Islands;Hong Kong",
                    "Label": "Person",
                    "Valid Until": "The Offshore Leaks data is current through 2010",
                    "Longitude": "-64.639968"
                }
            }
... ...

But only searching on id or category field returns any hits.

{
  "query": {
    "term": {
      "category": "person"
    }
  }
}
will return hits. But 
{
  "query": {
    "term": {
      "label": "person"
    }
  }
}
doesn't return any hits. Neither did most of other fields
{
    "took": 1,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 0,
            "relation": "eq"
        },
        "max_score": null,
        "hits": []
    }
}

Note that category is lower cased while Label start with an uppercase character.

In the query you however search for lowercased label.

1 Like

Using a Match query instead of Term query might solve the problem as well.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.