I actually had a look at Riak, I might even give it a try at some other project of mine.<br>Thank you for your input anyway.<br><br>----- Reply message -----<br>From: "Ryan Zezeski" <rzezeski@basho.com><br>Date: Sat, Sep 24, 2011 1:27 am<br>Subject: [erlang-questions] Full text search in KV-storage.<br>To: "Oleg Chernyh" <erlang@udaff.com><br>Cc: <erlang-questions@erlang.org><br><br><br>Oleg,<br><br>I know you said you don't want to use an external solution but perhaps Riak<br>[1] is an exception given it's design to scale out and the fact that it's<br>written in Erlang?  It has full-text search capability [2].  Might be worth<br>a look.<br><br>-Ryan<br><br><br>[1]: <a href="http://wiki.basho.com/Riak.html">http://wiki.basho.com/Riak.html</a><br><br>[2]: <a href="http://wiki.basho.com/Riak-Search.html">http://wiki.basho.com/Riak-Search.html</a><br><br>On Fri, Sep 23, 2011 at 12:19 PM, Oleg Chernyh <erlang@udaff.com> wrote:<br><br>> I'm writing a forum engine that can sustain high amount of users making<br>> queries at the same time.<br>> I'm using a KV storage that stores erlang entities which is the way to kill<br>> overheads and make data accessible really fast (if we know the key, ofc).<br>> The problem I'm facing is full-text search, as you might guess.<br>> I don't really want to use any external indexers or databases because I<br>> want that piece of software to be scalable node-wise and don't want to add<br>> any more data storage entites to the system to prevent data duplication and<br>> to ensure consistency.<br>> So what I want to do is to "invent bicycle" by implementing a full text<br>> search on a key-value storage.<br>><br>> Here I'll outline my plan for writing that feature and I'd be happy to hear<br>> criticism.<br>><br>> A simplistic way to think of a full text search engine is a strict text<br>> search engine, when the result of a search is a list of messages (posts)<br>> that contain full search keywords (if we search for "abc" only "abc" words<br>> are matched, so that "abcd" won't match).<br>> In order to accomplish that I can think of the following things to do:<br>> 1) We make a set of all words W<br>> 2) For each w \in W we have an "index" I_w which returns a list of all<br>> posts that contain w<br>><br>> When we add a pure full text search functionality (indeed, we might want<br>> "geology" to match "geologist") we do the following:<br>> 1) make a set of normalized words W_n<br>> 2) make a set of common prefixes P<br>> 3) make a set of common suffixes S<br>> 4) define a normalization function f that strips common suffixes and<br>> prefixes from a word<br>> 5) define a matching function m that maps f(w) to a list of words from the<br>> W_n set<br>> 5.1)<br>> 6) for each w in W_n we keep an "index" W_n that returns all the messages M<br>> for which \exists x \in M : m(f(x)) = w<br>> 7) for each word m in new message<br>><br>> ______________________________**_________________<br>> erlang-questions mailing list<br>> erlang-questions@erlang.org<br>> <a href="http://erlang.org/mailman/**listinfo/erlang-questions">http://erlang.org/mailman/**listinfo/erlang-questions</a><<a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>><br>><br><br><br>