It is possible to locate specific files, documents or information records in Krugle by either:
- (i) entering one or more terms to be matched in the Krugle search box or
- (ii) entering a (multi-line) snippet string in the Advanced Search Dialog.
The following focuses on (i), summarizing techniques for finding information by entering specific search commands.
Specifying Search Terms
A term is a sequence of letters, numbers and symbols. Krugle can search for single terms and term combinations. Terms can be created to produce exact matches, partial matches or pattern matches - by using the different Search Types:
Basic search is the default search type, and the easiest way to search for technical expressions, software syntax patterns, part numbers or identifiers containing symbols, numbers and letters. It has minimal restrictions on special characters, so that many technical search terms can be entered directly: PET/CT78816
*code_Name
a[i]-a[0]
object.method.option
Solr search is an advanced search type based on the expressive Apache Solr search syntax. This supports prefix, suffix, general wildcard and logical term combination searches. You can use wildcard searching for terms that contain a specific root or boolean expressions to combine terms. Get more information about Solr query options here.
Search Type is specified in the drop down menu immediately to left of the "Search" button.
Term Specification Examples
The following examples illustrate just a few of the many ways that search types are formed for typical Krugle searches:
- Phrase Query
"Hello, world!\n"
This Basic or Solr search type finds files that contain the (case insensitive) contents of the stringHello, world!\n
- Code Fragment
.initial_form_count()
Use the Basic search type to locate files containing the literal term.initial_form_count()
, without having to escape the special symbols. ( )
- Prefix Query
assert*
Use the Solr search option to find all terms that start withassert
, such asassertEquals
,assertTrue
, andassertFalse
- Suffix Query
*binding
Use the Solr search type to find files containing any term that ends withbinding
, such ashttpBinding
,ServiceBinding
, andearlyBinding
. NOTE: this is potentially a very slow query and should only be used if other query approaches are not possible.- Character Pattern
[0-9]{3}[h|o][5-9][0-9]
Use the Regular Expression search type to find terms starting with exactly 3 digits followed by a single letter that must beh
,H
,o
orO
and end with a two digit number between 50 and 99.
Term Qualifiers
Default result sets for Krugle show matches found in any part of a file or file metadata (filename, project, comments, etc.). Search Term Qualifiers will narrow/filter results based on where the terms are matched:
- project
btree project:alpha
Finds files containing the termbtree
in project with the termalpha
in the project name.- lang
btree lang:java
Finds files containing the termbtree
that were written in the Java programming language- filename
jaxb filename:"pom.xml"
Finds files namedpom.xml
that contain the termjaxb
- filename (by suffix)
btree filename:*.h
Finds files with the.h
extension that contain the termbtree
- site
btree site:"src/main/java"
Finds files containing the termbtree
that havesrc/main/java
in their file path- comment
comment:btree
Finds files containing the termbtree
in any comments section of code files- classdef
classdef:btree
Finds files containing a class definition with the namebtree
- functiondef
functiondef:btree
Finds files containing a function, subroutine of method definition with the namebtree
- funtioncall
functioncall:btree
Finds files containing a call to a function, subroutine or method with the namebtree
Term Operators
Term operators allow separate term specifications to be combined in a single search request:
- combine
"alpha test" btree filename:"*.pdf" site:src/text
Combines multiple qualifiers and search terms in a single query. Finds files containing either the phrasealpha test
or the termbtree
in files of filetypepdf
that havesrc/text
in their filepath- -(minus)
"text/xml" -"utf-8"
Finds files that contain the phrasetext/xml
, but that do not containutf-8
- ~
"alpha test"~10
Finds files that contain the termalpha
located within 10 terms of the termtest
Search Result Page Navigation
Use these keyboard shortcuts to navigate between search hits in result files:
- Next hit
n,N,j,J
- Previous hit
p,P,k,K