datagovua / edrpou-api

API читання ЄДР
http://edr.data-gov-ua.org/
Other
16 stars 1 forks source link

Faster search #9

Open Vanuan opened 8 years ago

Vanuan commented 8 years ago

regex search is too slow. Maybe full text search is enough?

Vanuan commented 8 years ago

https://github.com/mongodb-labs/mongo-connector/wiki/Usage-with-ElasticSearch

Vanuan commented 8 years ago

https://www.npmjs.com/package/waterline-elasticsearch

Vanuan commented 8 years ago
curl -XPUT 'http://46.101.102.213:9200/companies-index/_mappings/companies-type' -d '{
  "companies-type": {
    "properties": {
      "status": {
        "type": "string",
        "fields": {
          "raw": {
            "type": "string",
            "index": "not_analyzed"
          }
        }
      },
      "occupation": {
        "type": "string",
        "fields": {
          "raw": {
            "type": "string",
            "index": "not_analyzed"
          }
        }
      }
    }
  }
}'