Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

Search #50

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open

Search #50

wants to merge 37 commits into from

Conversation

davidkaneda
Copy link
Contributor

MongoDB search is pretty meh. This branch is the first stab at leveraging Elasticsearch.

Experiment adds query and search params to Entry#findByParams (supported in both templates and REST API). query defers to Elasticsearch's "simple query string" (better for filtering/templates), while search uses a "fuzzy" query with some simple defaults (better for autocomplete). Ended up using query for the typeahead anyway (adding a * to the end by default). Also adds Entry#fetchWithParams and typeahead.js to frontend, and a quick demo to the dashboard.

To do:

  • Currently setting query or search will override and ignore all other params sent in. We should port the other params to rely on Elasticsearch, but should also test the perf implications of certain combos.
  • Needs tests for modifying a Buckets fields after saving (try to break ES index)

MongoDB search is pretty meh. This branch is the first stab at leveraging Elasticsearch. More about Elasticsearch here: http://www.elasticsearch.org

Experiment adds `query` and `search` params to Entry#findByParams (supported in both templates and REST API). `query` defers to Elasticsearch's "simple query string" (better for filtering/templates), while `search` uses a "fuzzy" query with some simple defaults (better for autocomplete). Ended up using query for the typeahead anyway (adding a * to the end by default).

Add Entry#fetchWithParams and typeahead.js to frontend, and a quick demo to the dashboard.

Issues:
* Currently setting query or search will override and ignore all other params sent in. If people like this approach, we should port the function altogether to rely on Elasticsearch. (would be pretty straight-forward)
Still uses a timeout though :/ just want to try on Travis
Conflicts:
	server/routes/api/entries.coffee
Start to fill in Buckets route tests a bit
(and start a "prep" which waits for Mongo connection)
Discussed Model#refresh with mongoosastic contrib. Unfortunately still requires a timeout after initial indexing/refresh. Adds more tests.
Conflicts:
	client/source/templates/entries/row.hbs
	server/models/bucket.coffee
	server/models/entry.coffee
	server/routes/api/buckets.coffee
	server/routes/api/entries.coffee
	test/reset.coffee
	test/server/models/bucket.coffee
Conflicts:
	server/routes/api/entries.coffee
Conflicts:
	client/source/views/entries/browser.coffee
	package.json
	user/templates/index.hbs
Conflicts:
	test/reset.coffee
	test/server/models/entry.coffee
	test/server/routes/api/buckets.coffee
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant