Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Full text search #22

Closed
mezis opened this issue Mar 6, 2013 · 6 comments
Closed

Full text search #22

mezis opened this issue Mar 6, 2013 · 6 comments

Comments

@mezis
Copy link
Owner

mezis commented Mar 6, 2013

Idea titles should have more "weight".

Investigate use of fuzzily or use an external service.

@thejspr
Copy link
Contributor

thejspr commented Nov 30, 2013

Could we as an MVP search on idea (title, problem, solution, metrics) using postgres full text search (https://github.com/textacular/textacular) and displaying the results on a separate page?

@mezis
Copy link
Owner Author

mezis commented Nov 30, 2013

We could do that. Probably bearing in mind that we'd want it as an API down the line so we can have a nice search box in the header. What resource are you thinking? GET /ideas?q=query or POST /search?q=query ?

@thejspr
Copy link
Contributor

thejspr commented Dec 31, 2013

We could easily build it as an API to begin with and then consume it via JavaScript (Vanilla/Backbone/Ember/Angular/Etc.). Thoughts?

@mezis
Copy link
Owner Author

mezis commented Jan 1, 2014

That sounds like a plan. While I'm always slightly wary of making the DB do things it shouldn't, as long as things are well decoupled I don't mind.

For instance, Appfab stores attachments in the DB through Dragonfly and the custom Storage::File backend. The owner models don't know about any implementation details and just hold an ID for the attachments.

I'd suggest doing the same—instead of adding search indices to the Idea or Comment models, have a separate SearchableItems model that holds a copy of the text + references to the original models (syncing could be synchronous, async, or scheduled every 10min for instance). I think it'd be much easier to rip out / replace should we want to later.

Thoughts?

@mezis mezis closed this as completed Jan 2, 2014
@mezis mezis reopened this Jan 2, 2014
@thejspr
Copy link
Contributor

thejspr commented Jan 3, 2014

I like the idea of the models not knowing/caring about the search functionality, but duplicating the content seems too complex for a first iteration IMO. Especially as we don't need to add any indices, unless the search is slow in which case we can add full-text search indices. Alternatively we can create a database view (under tips and tricks) giving us the separation of concerns, whilst not having to worry about syncing the data.

In terms of JS, do you have a framework preference? I'd suggest Backbone as it's very flexible and the only one I know :)

@mezis
Copy link
Owner Author

mezis commented Feb 6, 2014

Let's close this for now. We can go post-MVP at a later point.

@mezis mezis closed this as completed Feb 6, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants