Best way for autocomplete fast search
Hello All,
what is the best method for search a portion of text in a non-indexed global?
I need to implement an autocomplete kind of search, in a global of >1M registers (text type, not $lb)
Maybe the best way would be use a SQL mapped class, with 'Bitmap' indexes?
Thanks in advance!
Discussion (4)0
Comments
Try using iFind indices:
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GIKNOW_ifind
See aside iFind.
I long ago did the tests, using Bible, at searching for of any substring.
- without an index
<FONT COLOR="#0000ff">select </FONT><FONT COLOR="#008000">Id</FONT><FONT COLOR="#000000">, </FONT><FONT COLOR="#008000">Para </FONT><FONT COLOR="#000080">from </FONT><FONT COLOR="#008000">BookPara </FONT><FONT COLOR="#000080">where </FONT><FONT COLOR="#008000">Para </FONT><FONT COLOR="#000000">like </FONT><FONT COLOR="#008080">'%огон%'</FONT>
- with index
<FONT COLOR="#0000ff">select </FONT><FONT COLOR="#008000">Id</FONT><FONT COLOR="#000000">, </FONT><FONT COLOR="#008000">Para </FONT><FONT COLOR="#000080">from </FONT><FONT COLOR="#008000">BookPara </FONT><FONT COLOR="#000080">where </FONT><FONT COLOR="#008000">id </FONT><FONT COLOR="#000000">%FIND </FONT><FONT COLOR="#808000">search_index</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008000">ParaStemmedI</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#008080">'огон'</FONT><FONT COLOR="#000000">,1)</FONT>
| The number of found rows | Performance (sec.) | Global references | |
|---|---|---|---|
| without an index | 287 | 0.518 | 151845 |
| with index | 287 | 0.009 | 1006 |
Hi, Romero!
Look at this project which does search for Documentation with iKnow and iFind by @Konstantin.Eremin. Demo. Github.
It uses iKnow for autocomplete functionality in a search box.
Thank you guys, for your fast answers! :-)