Full-text search example in F #?

Are there any good examples (sites or books) around how to build a full-text search engine in F #?

+3
source share
2 answers

Do you want to write it yourself? Or do you just need the functionality?

If you need functionality, a built-in / built-in database with full-text search support can do the trick. Since it is .Net, I would recommend the SQLite ADO.Net Provider as an open source challenger. This is really good (LINQ support in front of any other provider out there, development time support, etc.), and FTS support is in very active development. I think Google is working on it. There is also a VistaDB database . I use it mostly now. It must have FTS support. Overall .Net, which gives it some integration benefits.

, . , , . Amazon .

+1

F #, .

Stefan Savev

, , . -.

. .

1.   let create_postings in_name tmp_dir out_name =
2.     let process_doc (doc_id, doc_text) = 
3.         doc_text |> tokenize |> stopword |> stem 
4a.        |> List.count
4b.        |> ListExt.map(fun (word, tf) -> (word, (doc_id, tf)) 
5.     in_name 
6.     |> as_lines
7.     |> Seq.map_concat extract_docs 
8.     |> Seq.map_concat process_doc
9a.    |> External.group_by (fun (w, _) -> w) 
9b.       (fun (_, docid_and_tf) -> docid_and_tf) 
9c.       (fun lst -> (List.length lst, lst)) 
9d.       tmp_dir
9e.       (External.ElemDesc())
10.    |> output out_name
+1

Source: https://habr.com/ru/post/1697511/


All Articles