<p>I'm implementing a home storage solution and i'm having some difficulty with indexing my storage. My first and foremost requirement is pure Go solutions, to retain easy cross compiling.</p>
<p>With that said, i'd like basic querying features like SQL - nothing too crazy, but being able to query for rows with <code>modtime > (NOW-1w)</code>, but <em>also</em> be able to query full text search.</p>
<p>Full text search is proving to be the hard part for me. There are plenty of key/value databases in Go, and even a nice pure go SQL-like DB (<a href="https://godoc.org/github.com/cznic/ql" rel="nofollow">https://godoc.org/github.com/cznic/ql</a>), but nothing i've found that offers db features <em>and</em> full text search.</p>
<p>On the full text front, <a href="http://www.blevesearch.com/" rel="nofollow">Bleve</a> is amazing, but again that's just one half of the equation. Bleve handles the text search, but not the SQL-like queries.</p>
<p>I thought about perhaps using one to filter results of the other, but that's subject to many issues on it's own.</p>
<p>Anyway, is there a sane option i'm missing?</p>
<hr/>**评论:**<br/><br/>mm_5687: <pre><p>I doubt you'll find anything in pure Go, but I'll be delighted to be proven wrong by someone.</p>
<p>I've used <a href="http://rachbelaid.com/postgres-full-text-search-is-good-enough/" rel="nofollow">Postgres</a> in the past for this sort of thing, and it works really, really well, but clearly doesn't satisfy the pure Go requirement.</p></pre>PhoRaptor: <pre><p>I'm <em>really</em> trying to stay pure go, but i suppose if i break, i may go with PG. Appreciate the link!</p></pre>niosop: <pre><p>Bleve will do basic querying. It has numeric and date range support, as well as field scoping. If your need for SQL is limited, then Bleve might be enough on its own.</p></pre>samuraisam: <pre><p>You could use sqlite via cgo </p></pre>PhoRaptor: <pre><p>Isn't cross compiling sqlite a pain though?</p></pre>samuraisam: <pre><p>The SQLite amalgamation file is very portable C code. Compiles on every major platform. </p></pre>LeafGoBap: <pre><p>As an aside, can you use FTS with Sqlite?</p>
<p><em>edit</em>: Seems yes <a href="https://github.com/mattn/go-sqlite3/issues/340" rel="nofollow">https://github.com/mattn/go-sqlite3/issues/340</a></p></pre>samuraisam: <pre><p>Yep it's basically just a compile flag</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传