0

I am trying to study some rethinkdb for my next project. My backend is in Haskell and rethink db haskell driver looks a bit better then mongodb. So I want to try it.

My question is how do you do simple text search with rethinkdb? Nothing too complex. Just find field which value contains these words. I assume this should be built in as even a smallest blog app needs a search facility of some kind, right?.

So I am looking for a mongodb equivalent of:

var search = { "$text": { "$search": "some text" } };

Thank you.

EDIT

I am not looking for regular expressions and the match function.

  1. It is extremely slow for more or less large sets.
  2. I does not have any notion of indexes.
  3. It does not have any notion of stemming.
r.sendecky
  • 9,933
  • 9
  • 34
  • 62

1 Answers1

0

With the rethinkdb driver documented here

run h $ table "table" # R.filter (\row -> match "some text" (row ! "field"))
Etienne Laurin
  • 6,731
  • 2
  • 27
  • 31
  • Thanks for your help. But this is not the equivalent of the mongodb text search shown above. I am aware of the match function and the regex. See the edit ... – r.sendecky May 13 '15 at 00:18
  • RethinkDB doesn't have mongodb-style text indexes. It has multi-indexes, which can be used sort of similarly with `split`, but which are limited to 256 values per row. (Note that text indexes tend to have poor performance for large datasets because they require one index entry per word.) If you need text indexes for your use case, mongodb would probably be a better choice. – mlucy May 13 '15 at 01:18