o2r-project / o2r-finder

Node.js implementation of search features for the o2r API
Apache License 2.0
1 stars 3 forks source link

Put compendia and jobs into different indices instead of using types #18

Closed nuest closed 6 years ago

nuest commented 6 years ago

Compendia and jobs are completely different. Here are the Elasticsearch mappings (via http://localhost:9200/_mapping):

image

"Do your documents have similar mappings? If no, use different indices." via https://www.elastic.co/blog/index-vs-type

So, they should go into indices o2r-compendia and o2r-jobs, and the /search endpoint should have a property docs (?) to search for only specific or both, see https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-search.html#search-multi-index-type

Queries to be supported:

../search?q=my-search-term&resource=all (default)
../search?q=my-search-term&resource=job
../search?q=my-search-term&resource=compendium
../search?q=my-search-term&resource=compendium,job (effectively the same as "all")