An Eclipse Plug-in for Code Search
Information Retrieval Engine
Francesco Di Cerbo
Free University of Bolzano-Bozen
● Search is becoming an important aspect of
software development motivated by
growing code sizes and open-source
● Moreover, users (and also developers) are
getting used to full-text searches for
emails and file contents.
● Why not creating a plugin to support full-
text searches in Eclipse?
Searches in Java: Lucene
● Lucene is an
● It is FLOSS, and is
used in many other
Lucene in Eclipse
● Lucene is part of Eclipse.
● NOT for the Search functions!
● It is mostly used for the Eclipse Help!
● … Why not using it for CODE?
● InstaSearch provides powerful and flexible
code search with high performance.
● It offers flexibility through Lucene query
syntax, defining a set of specific fields for
● The currently available fields are:
file Full path of the file
name Name of the file
ext Extension of the file
proj Name of the project containing the file
jar Name of the jar if file is stored in a jar
contents Contents of the file (default search field)
ws Working set containing projects (virtual field)
● Supported search types:
● wildcard searches to search using a substring:
● app* initialize
● searches on fields value:
● proj:MyProject ext:java,xml application init
● ws:MyWorkingSet application init
● fuzzy searches to find similar matches:
● application init~
● advanced queries:
● index AND (directory OR dir)
Instasearch components (1/2)
● It reads files from the workspace and splits the
text into a set of tokens. Both the original
word and its split parts are indexed thus
allowing to search for parts of identifiers as
well as searching for the exact identifier.
● The Indexer collects files with their tokens and
writes them to Lucene index. The meta-data
associated with each file is specified using
several fields which can later be used in a
Lucene search query to filter results.
Instasearch components (2/2)
● Query analyzer
● Parses the search text entered by the user and
creates a search query which is used to
retrieve the files from the index. It also
elaborate the search queries, e.g. dealing with
● Instasearch View
● Performs all UI interactions for getting the
search text and displaying a list of matching
files. The search is performed while the search
text is being typed thus allows the user to tune
it quickly for more relevant results.
● Instasearch is very fast, using a dynamic
update mechanism it does not intefere
with usual Eclipse tasks.
● It is released under EPL license, it is
available on the Eclipse Market, and it is
hosted on Free University of Bolzano-
Bozen FLOSS forge.
Thanks for your attention!
Francesco Di Cerbo
Mark Instasearch as favourite on
the Eclipse Market!