I want to show users a history of their searches, which can often be complicated:
any of these terms:
all of these terms:
not these colors:
Since these searches are done through a UI (not a search input where they would type "
a OR b etc...") I assume I would need to store each value in a table.
Would it be overkill to create a table for each facet (
"search_terms", "search_colors", etc)? or is there a simpler way?
| search_id | term(_id) | operator(enum)| |:---------:|:------------:|:-------------:| | 1 | blue | any | | 1 | green | any | | 1 | red | any | | 1 | musthave | all | | 1 | exclude_me | not | | 1 | exclude_also | not |
Some other considerations are:
- The web-URL can change over time, so I don't want to store that as an easy way out.
- The index/3rd party service I'm searching could change, so I similarly can't save the query I make.
(The terms themselves can be its own table with a reference instead).