2016-06-21 2 views
0

Я работаю над elasticsearch 2.3.3. При запросе поиска я получаю результаты только при указании имени поля. т.е.Требуется поиск искомой карты вместо определенного имени поля в elasticsearch

GET /mydocs/_search?q=file.content:cat 

, но мне нужно искать, не указав название поля. Как это возможно?

Ответ http://localhost:9200/mydocs

{ 
"mydocs":{ 
    "aliases":{ 

    }, 
    "mappings":{ 
    "indexdocument":{ 
     "properties":{ 
      "docLocation":{ 
       "type":"string", 
       "index":"not_analyzed", 
       "store":true 
      }, 
      "documentType":{ 
       "type":"string", 
       "store":true 
      }, 
      "file":{ 
       "type":"attachment", 
       "fields":{ 
       "content":{ 
        "type":"string", 
        "analyzer":"full" 
       }, 
       "author":{ 
        "type":"string" 
       }, 
       "title":{ 
        "type":"string", 
        "term_vector":"with_positions_offsets", 
        "analyzer":"full" 
       }, 
       "name":{ 
        "type":"string" 
       }, 
       "date":{ 
        "type":"date", 
        "format":"strict_date_optional_time||epoch_millis" 
       }, 
       "keywords":{ 
        "type":"string" 
       }, 
       "content_type":{ 
        "type":"string" 
       }, 
       "content_length":{ 
        "type":"integer" 
       }, 
       "language":{ 
        "type":"string" 
       } 
       } 
      }, 
      "filePermissionInfo":{ 
       "properties":{ 
       "accessControlType":{ 
        "type":"string", 
        "store":true 
       }, 
       "accountValue":{ 
        "type":"string", 
        "store":true 
       }, 
       "fileSystemRights":{ 
        "type":"string", 
        "store":true 
       }, 
       "isInherited":{ 
        "type":"string", 
        "store":true 
       } 
       } 
      }, 
      "id":{ 
       "type":"double", 
       "store":true 
      }, 
      "lastModifiedDate":{ 
       "type":"date", 
       "store":true, 
       "format":"strict_date_optional_time||epoch_millis" 
      }, 
      "title":{ 
       "type":"string", 
       "store":true, 
       "term_vector":"with_positions_offsets" 
      } 
     } 
    } 
    }, 
    "settings":{ 
    "index":{ 
     "creation_date":"1466482894271", 
     "analysis":{ 
      "filter":{ 
       "snowball":{ 
       "type":"snowball", 
       "language":"English" 
       } 
      }, 
      "analyzer":{ 
       "full":{ 
       "filter":[ 
        "lowercase", 
        "snowball" 
       ], 
       "type":"custom", 
       "tokenizer":"standard" 
       } 
      } 
     }, 
     "number_of_shards":"5", 
     "number_of_replicas":"1", 
     "uuid":"PpxcRl29QTCPtFcsd3PHtw", 
     "version":{ 
      "created":"2030399" 
     } 
    } 
    }, 
    "warmers":{ 

    } 
} 
} 
+0

Можете ли вы обновить свой вопрос с ответом, полученным от 'GET/mydocs'? – Val

+0

Вы хотите выполнить запрос 'querystring' во всех строковых полях? https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html –

+0

@RussCam Пользователь не знает никаких имен полей, они будут вводить текст для поиска (Я использую кибану). Мы внутренне должны проверить, содержится ли данный текст в заголовке или прикрепленном контенте. Можно ли использовать кибану? –

ответ

0

В соответствии с @ RussCam замечания, установка index.query.default_field поможет сделать поиск поля по умолчанию Чтобы установить это с помощью клиента Nest см ниже ссылкой Set index.query.default_field using NEST Client c#

Смежные вопросы