Databases Reference
In-Depth Information
parameter types alphabetically and by concatenating (“flattening”) method names,
parameter and return types into a single field as shown in the following example:
mn:doSomethingUseful_rt:int_pt:int_pt:String
In order to avoid confusing operation names with parameter types and visibil-
ity, special separators are added to the field entry for the sake of human readability.
To enable searches with and without visibility modifiers, the above example can be
stored twice, once as shown and once with e.g. “vs:public” added to it to indicate
its visibility. It should be obvious that search requests have to be translated into
this format by an appropriate query parser before searches are executed in order to
increase usability. We discuss this issue in more detail in the next subsection.
Unfortunately, wildcard searches on these structures (e.g. ignoring the method
name) are not possible due to internal restrictions of Lucene. However, it is possible
to enable at least pure signature matching [ 11 ] for the operations by storing another,
largely identical field without the method name merely containing parameter and
return types. In the case of the above example, this would yield:
rt:int_pt:int_pt:String
Yet another problem can occur in this context when an identical signature is re-
quired more than once in one artifact since it is not directly possible to specify the
number of required occurrences. Again, it is possible to circumvent the problem,
this time by preceding each signature with a counter of the number of times it
appears in the component, i.e.
1_rt:int_pt:int_pt:String
2_rt:int_pt:int_pt:String
When an incoming search request is “translated” appropriately, this makes it possi-
ble to search for classes that contain the required signature once as well as twice,
or any required number of times. As shown in Table 5.2 , Merobase adds five
more fields to the previously described index template based on the concepts just
described.
Table 5.2: Additional index fields for structural searches
Example
Field
mn:doSomething_rt:int_pt:int_pt:String
methodHeader
mn:doSomething_rt:int_pt:int_pt:String_vs:public
methodHeaderV
methodSignature
rt:int_pt:int_pt:String
pt:int_pt:String
constrHeader
constrHeaderV
pt:int_pt:String_vs:public
Search WWH ::




Custom Search