* WIP adding custom analyzer so we can do substring search efficiently
* Adding unit tests for title search
* formatting
* adds more title search unit tests
* organize helpers
* fixes issue caused by having two title mappings
* Removes camelcase token filter since it prevents you from searching for a substring of chars and numbers. Adds regression test.
* adds back mapping for title_phrase
* use simple analyzer for input query string so it doesn't filter out english stop words
* ran bleve tests, table snapshots updated
* ignore linter for "unused" test functions. They are very helpful for troubleshooting search. Keeping them.
* only log total hits and query cost if result not nil
* fixes failing test - one more field because there are two title mappings now
* fix test
* fixes test - only take first item when its the title
* Adds separate internal field for title ngram mapping.
When searching with a query, results are sorted by score desc.
When searching without a query, results are sorted by title desc.
Adjusts ngram max to be 10.
Text queries are a disjunction of an exact match, phrase match, and a match. Boosted to have priority in that order.
Adds more unit tests for searching.
* linter
* fix test
* ran tests - generated new test dash json
* sort by title phrase instead of title
* fix test - not relying on /apis/dashboard/search to apply title sorting anymore
* wip. adding sprinkles fields.
* some refactoring. Works with sprinkles now.
* exclude top level dashboard hit fields from hit "fields"
* adds unit test for DecodeCell helper
* test can search for specific dashboard fields on bleve index
* adds search handler tests for the fields and tests for fields when transforming the search req to a bleve search req
* fix panic when calling fields.Set() with int32
* adds regression test
* remove unneeded method on test mock client
* fix linter issues
* updates dashboard test data for bleve tests
* remove DASHBOARD_LEGACY_ID from bleve_tests
* dont cast twice
* updates test to sort by dashboard_views_last_1_days
* declare excludedFields outside of function
* fixes sorting by dashboard fields - prepends "fields." to any dashboard fields we try to sort by
* uses map for excludedFields
* expects fields to be array-style url param
* change method name
* fixes failing tests - needed to add column type to mocks
wire up the ui to the new search api
Co-authored-by: Scott Lepper <scott.lepper@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Dan Cech <dcech@grafana.com>