Basic query language / database with full text search?

polaris · · 446 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m implementing a home storage solution and i&#39;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&#39;d like basic querying features like SQL - nothing too crazy, but being able to query for rows with <code>modtime &gt; (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&#39;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&#39;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&#39;s subject to many issues on it&#39;s own.</p> <p>Anyway, is there a sane option i&#39;m missing?</p> <hr/>**评论:**<br/><br/>mm_5687: <pre><p>I doubt you&#39;ll find anything in pure Go, but I&#39;ll be delighted to be proven wrong by someone.</p> <p>I&#39;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&#39;t satisfy the pure Go requirement.</p></pre>PhoRaptor: <pre><p>I&#39;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&#39;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&#39;s basically just a compile flag</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

446 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传