[vwnc] SearchLight ...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] SearchLight ...

support.smalltalk
Hi there,
 
SearchLight is a bit restrictive if we consider that it searches only for an exact criteria : criteria = literal in the following method...
We suggest to improve this method to allow more global researches using #match: instead of #= :
 
Searchlight.SearchImage>>searchLiterals
    <search>
    MethodsCache current literalsIndex keysAndValuesDo: [:literal :methods |
        "criteria = literal ifTrue:"
        (criteria match: literal) ifTrue:
            [methods do: [:method |
                self add: [MethodLiteral new method: method; literal: literal; yourself] score: 0]]]
 

Does that make sense to you ?

MMA


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] SearchLight ...

Michael Lucas-Smith-2
On 1/25/10 1:12 AM, support.smalltalk wrote:
Hi there,
 
SearchLight is a bit restrictive if we consider that it searches only for an exact criteria : criteria = literal in the following method...
We suggest to improve this method to allow more global researches using #match: instead of #= :
 
Searchlight.SearchImage>>searchLiterals
    <search>
    MethodsCache current literalsIndex keysAndValuesDo: [:literal :methods |
        "criteria = literal ifTrue:"
        (criteria match: literal) ifTrue:
            [methods do: [:method |
                self add: [MethodLiteral new method: method; literal: literal; yourself] score: 0]]]
 

Does that make sense to you ?

What's the performance hit? Please measure and discuss :)

Michael

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] SearchLight ...

Holger Kleinsorgen-4
Hello,

I also felt that substring matching was a good idea, so I played a bit
with it. Performance does not seem to be the main issue: using an
arbitrary test set of 100 Strings, performance penalty was roughly 30%.

The main issue is that you sometimes get a lot of literal matches, which
all have the same score (5). For large lists literals, it might be
convenient to inline the preview snippet in the search result view.

Am 25.01.2010 21:51, schrieb Michael Lucas-Smith:

> On 1/25/10 1:12 AM, support.smalltalk wrote:
>> *Hi there,*
>> **
>> *SearchLight is a bit restrictive if we consider that it searches only
>> for an exact criteria : */criteria = literal/ in the following method...
>> *We suggest to improve this method to allow more global researches
>> using #match: instead of #= :*
>> *Searchlight.SearchImage>>searchLiterals*
>> <search>
>> MethodsCache current literalsIndex keysAndValuesDo: [:literal :methods |
>> "criteria = literal ifTrue:"
>> (*criteria match: literal*) ifTrue:
>> [methods do: [:method |
>> self add: [MethodLiteral new method: method; literal: literal;
>> yourself] score: 0]]]
>>
>> *Does that make sense to you ?*
>>
> What's the performance hit? Please measure and discuss :)
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc