美文网首页
OpenGrok 搜索用法

OpenGrok 搜索用法

作者: 戈壁堂 | 来源:发表于2020-08-24 18:12 被阅读0次

部署安装OpenGrok {O之后需要使用——

  • 主页的Help按钮包含了基础的使用方法
  • 官方API调用说明文档:opengrop API on apiary(Powerful API Design Stack. Built for Developers)
  • openGrok底层使用lucene,支持的正则表达式参考Lucene regexp page

搜索引擎对比——

23 Google Search Tips You'll Want to Learn
https://www.google.com/advanced_search
https://www.google.com/advanced_image_search
搜索操作符支持,类似的google支持的Search operators

  • Full Search (full) Search through all text tokens (words,strings,identifiers,numbers) in index.
  • Definition (defs) Only finds symbol definitions (where e.g. a variable (function, ...) is defined).
  • Symbol (refs) Only finds symbols (e.g. methods, classes, functions, variables).
  • File Path (path) path of the source file (no need to use dividers, or if, then use "/" - Windows users, "" is an escape key in Lucene query syntax!
    Please don't use "", or replace it with "/").
    Also note that if you want just exact path, enclose it in "", e.g. "src/mypath", otherwise dividers will be removed and you get more hits.
  • History (hist) History log comments.

A Query is a series of clauses. A clause may be prefixed by:

  • a plus "+" or a minus "-" sign, indicating that the clause is required or prohibited respectively; or
  • a term followed by a colon ":", indicating the field to be searched. This enables one to construct queries which search multiple fields.

A clause may be either:

  • a term, indicating all the documents that contain this term; or
  • a phrase - group of words surrounded by double quotes " ", e.g. "hello dolly"
  • a nested query, enclosed in parentheses "(" ")" (also called query/field grouping. Note that this may be used with a +/- prefix to require any of a set of terms.
  • boolean operators which allow terms to be combined through logic operators. Supported are AND(&&), "+", OR(||), NOT(!) and "-" (Note: they must be ALL CAPS).

Regular Expression, Wildcard, Fuzzy, Proximity & Range Searches:

  • to perform a regular expression search use the "/" enclosure, e.g. /[mb]an/ - will search for man or for ban;
    NOTE: path field search escapes "/" by default, so it only supports regexps when the search string <u>starts and ends</u> with "/".
    More info can be found on Lucene regexp page.
  • to perform a single character wildcard search use the "?" symbol, e.g. te?t
  • to perform a multiple character wildcard search use the "*****" symbol, e.g. test* or te*t
  • you can use a * or ? symbol as the first character of a search (unless not enabled using indexer option -a).
  • to do a fuzzy search (find words similar in spelling, based on the Levenshtein Distance, or Edit Distance algorithm) use the tilde, "~", e.g. rcs~
  • to do a proximity search use the tilde, "~", symbol at the end of a Phrase. For example to search for a "opengrok" and "help" within 10 words of each other enter: "opengrok help"~10
  • range queries allow one to match documents whose field(s) values are between the lower and upper bound specified by the Range Query. Range Queries can be inclusive or exclusive of the upper and lower bounds. Sorting is done lexicographically. Inclusive queries are denoted by square brackets [ ] , exclusive by curly brackets { }. For example: title:{Aida TO Carmen} - will find all documents between Aida to Carmen, exclusive of Aida and Carmen.

相关文章

  • OpenGrok 搜索用法

    部署安装OpenGrok {O之后需要使用—— 主页的Help按钮包含了基础的使用方法 官方API调用说明文档:o...

  • OpenGrok环境搭建

    OpenGrok介绍 OpenGrok为一个方便快速的源码搜索及交叉引用查询引擎。它以Java编写,可用于源码搜索...

  • OpenGrok 搜索实操

    /Sonar@/ 匹配任意string-"void main( String[] args )" +"main"...

  • OpenGrok tools使用

    OpenGrok项目管理 最后使用 opengrok-indexer时参数其实传递错误。 opengrok-ind...

  • 源码阅读工具 - OpenGrok

    简介: OpenGrok一个快速、便于使用的源代码搜索与对照引擎。它帮助你搜索,对照,定位你的源代码树。它能够明白...

  • opengrok搭建

    opengrok是看代码的利器,主页为 https://github.com/oracle/opengrok 下载...

  • OpenGrok 使用方法

    OpenGrok 使用方法 20170612 初始版本,添加文档 官方路径 http://opengrok.git...

  • OpenGrok 认证

    将gitlab上的项目作为OpenGrok的输入,直接可以搜索全量代码。需要做基本的认证。 申请内部域名,支持域名...

  • 代码阅读工具opengrok

    代码阅读工具opengrok

  • Docker-OpenGrok的安装及使用

    安装OpenGrok要安装一堆东西,偷个懒,使用别人配置好的docker镜像来使用opengrok,以下为具体步骤...

网友评论

      本文标题:OpenGrok 搜索用法

      本文链接:https://www.haomeiwen.com/subject/clonjktx.html