首页 \ 问答 \ 当关键字包含符号时,sphinx搜索错误(sphinx search error when keyword contains symbol)

当关键字包含符号时,sphinx搜索错误(sphinx search error when keyword contains symbol)

我试着在手稿表中搜索包含一些数据,如'100021 / hello','199900 / hello'等。

 search -c /etc/sphinx/sphinx.conf 100021/hello

它显示索引错误,但是当我尝试搜索100021或hello时,它可以返回正确的结果。

 search -c /etc/sphinx/sphinx.conf 100021
 search -c /etc/sphinx/sphinx.conf hello

在搜索过程中,似乎狮身人面像无法识别'/'?


I try to search in the manuscript table contain some data like '100021/hello', '199900/hello' etc.

 search -c /etc/sphinx/sphinx.conf 100021/hello

it shows index error, but when i try to search 100021 or hello,it can return right result.

 search -c /etc/sphinx/sphinx.conf 100021
 search -c /etc/sphinx/sphinx.conf hello

It seems sphinx can't recognize '/' in during searching?


原文:https://stackoverflow.com/questions/18524851
更新时间:2023-08-12 06:08

最满意答案

Groovy附带BenchmarkInterceptor

Interceptor在调用之前和之后注册每个方法调用的时间戳。 时间戳存储在内部,可以通过

getCalls()

statistic()

API。

用法示例:

def proxy = ProxyMetaClass.getInstance(ArrayList.class)
proxy.interceptor = new BenchmarkInterceptor()
proxy.use {
    def list = (0..10000).collect{ it }
    4.times { list.size() }
    4000.times { list.set(it, it+1) }
}
proxy.interceptor.statistic()

其中产生以下输出:

[[size, 4, 0], [set, 4000, 21]]

Groovy ships with BenchmarkInterceptor:

Interceptor that registers the timestamp of each method call before and after invocation. The timestamps are stored internally and can be retrieved through the with the

getCalls()

and

statistic()

API.

Example usage:

def proxy = ProxyMetaClass.getInstance(ArrayList.class)
proxy.interceptor = new BenchmarkInterceptor()
proxy.use {
    def list = (0..10000).collect{ it }
    4.times { list.size() }
    4000.times { list.set(it, it+1) }
}
proxy.interceptor.statistic()

Which produces the following output:

[[size, 4, 0], [set, 4000, 21]]

相关问答

更多
  • 使用Calendar , Calendar cal=Calendar.getInstance();//it return same time as new Date() def hour = cal.get(Calendar.HOUR_OF_DAY) 有关详细信息,请阅读此文档 。 Use Calendar, Calendar cal=Calendar.getInstance();//it return same time as new Date() def hour = cal.get( ...
  • Groovy附带BenchmarkInterceptor : Interceptor在调用之前和之后注册每个方法调用的时间戳。 时间戳存储在内部,可以通过 getCalls() 和 statistic() API。 用法示例: def proxy = ProxyMetaClass.getInstance(ArrayList.class) proxy.interceptor = new BenchmarkInterceptor() proxy.use { def list = (0..10000) ...
  • 解决方案是从~/Library/Preferences//options/ (OSX EI capitan)中删除dslActivationStatus.xml 这是intellij支持团队在调查几天后提出的。 The solution was to remove dslActivationStatus.xml from ~/Library/Preferences//options/ (OSX El capitan) This was su ...
  • 实现它的一种方法是在类中使用内部标志。 然后根据标志调用不同的实现。 Sql.metaClass.first = true Sql.metaClass.call = {String sql, List params, Closure c -> if (first){ c(mockResultSet) first = false }else{ c(expectedLookupId) } } One way to implement it wo ...
  • 我认为你能做的最好的事情是写下这样的东西: def dumpOut( clz ) { clz.metaClass.methods.each { method -> println "${method.returnType.name} ${method.name}( ${method.parameterTypes*.name.join( ', ' )} )" } } dumpOut String.class 哪个会打印出来: boolean equals( java.lang.Objec ...
  • @ EOF的评论涵盖了主要原因。 CPU性能计数器可以跟踪分支错误预测,因此您可以查看该分支是否预测不佳。 使用Linux perf或Intel的Vtune,或其他任何可用的。 perf stat ./some-program # a quick summary, not broken down by insn perf record -e branch-misses ./some-program perf report # poke around at which instructions had ...
  • 在这个问题中有一个很好的网站列表 - http://www.quora.com/Who-has-deployed-a-medium-large-website-succesfully-on-Groovy-Grails There is a good list of sites in this quora question - http://www.quora.com/Who-has-deployed-a-medium-large-website-succesfully-on-Groovy-Grails
  • 对于热点jvm启动jvm与-XX:+PrintGCDetails它将开始记录gc事件,其中包括花费的时间 如果要将其重定向到文件 -Xloggc:/home/someuser/app/logs/jvm/gc.log -verbose:gc -XX:+PrintGCDateStamps -XX:+PrintGCDetails http://www.oracle.com/technetwork/java/javase/community/vmoptions-jsp-140102.html For hotspo ...
  • 好的,这是GetThreadTimes 。 在这种情况下,有趣的参数是UserTime,但如果你在函数中调用内核,我怀疑添加KernelTime并不是一个好主意,因为如果你的线程被中断,你总是可以得到一些不是真正属于你的东西。 如果MS声明这些时间是否更新了上下文切换(他们可能是但我想听到它),这也会很好。 Alright this is it GetThreadTimes. The interesting parameter is the UserTime in this case, although i ...
  • 您的列表中没有元素。 逻辑上,如果列表为空,则every返回true(因为集合中的每个元素 - 所有0个 - 通过测试) assert [].every { it == 1 } == true There are no elements in your list. Logically every returns true if the list is empty (as every element in the collection -- all 0 of them -- passes the test) ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)