2

I am making a web application using the javascript framework Meteor, which runs with mongodb. In the web app I have a db set up that holds individual video games in the documents. An example of this would be the video game Fallout 4. The document would contain the title of the game, the genre, and what consoles it runs on.

I have a mongodb filled with a bunch of games like this, and I want to make it so a user can type in a text value to a search bar, and it will reveal the game which matches the value.

I hear this is called a full text search, and I have heard that newer versions of mongodb make it very easy to use, and I have also heard about frameworks like elasticSearch which make it faster. The problem I have is that I cannot figure out how to implement any of these into my own web app.

  • 1
    Your data is actually quite structured. Are you sure that NoSQL is really the right approach? – James Youngman Mar 15 '16 at 20:53
  • @JamesYoungman well meteor only has support for mongo right now so it was not really my choice, but on the other hand does it really matter that it is structured? From what I heard mongo deals well with both structured and unstructured. – Dylan Mar 16 '16 at 0:54
3

Full text search in Meteor is supported in Meteor 1.0.4 or later.

In order to perform a full text search you'll, need to build a text index. This is a data structure that allows MongoDB to efficiently perform text searches. Whenever data is inserted or removed from the indexed collection, MongoDB updates the corresponding index.

Here is a "Guide to Full Text Search in Meteor" with example code to get you started.

https://www.okgrow.com/posts/guide-to-full-text-search-in-meteor

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.