Hi,
I need to implement "smart" search which should not take into account spanish special characters, but their ascii equivalent instead, examples are á, í and so on. For instance we might have entered as a person last name into the db "García", but when searching we would like to find this last name no matter if we write "Garcia" or García. Do we have such functionality in OFBiz and if not could you give me some suggestions/tips for starting such implementation. Thanks : Valentina |
It sounds like you want to search for people, and Person is a type of Party, so you're looking for a Party search. There is Party search functionality in the Party Manager, it's actually the main page there (or click on the Find menu button near the top). The current functionality does support non-case-sensitive searches, but does not replace special characters with ASCII characters. You could somewhat easily modify the findParty service (which is what the Party Manager Find screen uses) to do that. -David On Mar 26, 2009, at 3:48 PM, Valentina Sirkova wrote: > Hi, > > I need to implement "smart" search which should not take into > account spanish special characters, but their ascii equivalent > instead, examples are á, í and so on. > For instance we might have entered as a person last name into the db > "García", but when searching we would like to find this last name no > matter if we write "Garcia" or García. > Do we have such functionality in OFBiz and if not could you give me > some suggestions/tips for starting such implementation. > > Thanks : Valentina |
Thanks David,
Yes, I will probably make use of findParty service. However the search algorithm might be really hard becuse we might get huge number of combinations of possible substitutions of the special characters depending on the size of the string...One simple example: We have in the db García. But we search by Garcia - then according to the mapping table we get the following combinations: García Gárciá Gárcíá These algorithm might get even more complicated when we try to enable such "smart" search for more languages. I would be grateful if someone from the community(maybe french people also have such problematics) has some tips about this or knows about some good implementation of this issue. Thanks : Valentina On Mar 27, 2009, at 12:35 AM, David E Jones wrote: > > It sounds like you want to search for people, and Person is a type > of Party, so you're looking for a Party search. > > There is Party search functionality in the Party Manager, it's > actually the main page there (or click on the Find menu button near > the top). > > The current functionality does support non-case-sensitive searches, > but does not replace special characters with ASCII characters. You > could somewhat easily modify the findParty service (which is what > the Party Manager Find screen uses) to do that. > > -David > > > On Mar 26, 2009, at 3:48 PM, Valentina Sirkova wrote: > >> Hi, >> >> I need to implement "smart" search which should not take into >> account spanish special characters, but their ascii equivalent >> instead, examples are á, í and so on. >> For instance we might have entered as a person last name into the >> db "García", but when searching we would like to find this last >> name no matter if we write "Garcia" or García. >> Do we have such functionality in OFBiz and if not could you give me >> some suggestions/tips for starting such implementation. >> >> Thanks : Valentina > |
This isn't a problem unique to internationalization... it happens in all sorts of different situations. For example, consider the case of case-insensitive searches. If you tried to expand the inputs to include all possible combinations of letter cases you would get 2 to the X combinations where X is the number of letters in the search string. So yes, that is not the normal way to do it. I hate to say that this is kind of a computer science 101 type of thing, but I guess it is like those puzzles where the solution isn't obvious until you know the answer. In this case the common answer is to normalize both sides of the comparison. In case-insensitive searches that means upper- or lower-casing both the search string and the string in the database. That's the concept, now applying it is a little more difficult if the database doesn't have a function for normalizing to ASCII characters. There are certainly ways though, like keeping both an original and a normalized string in the database... -David On Mar 26, 2009, at 6:11 PM, Valentina Sirkova wrote: > Thanks David, > > Yes, I will probably make use of findParty service. > > However the search algorithm might be really hard becuse we might > get huge number of combinations of possible substitutions of the > special characters depending on the size of the string...One simple > example: > We have in the db García. But we search by Garcia - then according > to the mapping table we get the following combinations: > García > Gárciá > Gárcíá > These algorithm might get even more complicated when we try to > enable such "smart" search for more languages. > > I would be grateful if someone from the community(maybe french > people also have such problematics) has some tips about this or > knows about some good implementation of this issue. > > Thanks : Valentina > > On Mar 27, 2009, at 12:35 AM, David E Jones wrote: > >> >> It sounds like you want to search for people, and Person is a type >> of Party, so you're looking for a Party search. >> >> There is Party search functionality in the Party Manager, it's >> actually the main page there (or click on the Find menu button near >> the top). >> >> The current functionality does support non-case-sensitive searches, >> but does not replace special characters with ASCII characters. You >> could somewhat easily modify the findParty service (which is what >> the Party Manager Find screen uses) to do that. >> >> -David >> >> >> On Mar 26, 2009, at 3:48 PM, Valentina Sirkova wrote: >> >>> Hi, >>> >>> I need to implement "smart" search which should not take into >>> account spanish special characters, but their ascii equivalent >>> instead, examples are á, í and so on. >>> For instance we might have entered as a person last name into the >>> db "García", but when searching we would like to find this last >>> name no matter if we write "Garcia" or García. >>> Do we have such functionality in OFBiz and if not could you give >>> me some suggestions/tips for starting such implementation. >>> >>> Thanks : Valentina >> > |
In reply to this post by Valentina Sirkova
On my application I have integrated SOLR into the system. SOLR is great for complex searches and comes with word filters and alike :)
|
I have also used lucene with ofbiz for a recent development (SOLR is
based on it). It comes with a filter which does exactly what Valentina is looking for. -- Daniel madppiper escribió: > On my application I have integrated SOLR into the system. SOLR is great for > complex searches and comes with word filters and alike :) > |
Thanks everyone for the valuable comments.
Valentina On Mar 27, 2009, at 11:11 AM, Daniel Martínez wrote: > I have also used lucene with ofbiz for a recent development (SOLR is > based on it). It comes with a filter which does exactly what > Valentina is looking for. > -- > Daniel > > madppiper escribió: >> On my application I have integrated SOLR into the system. SOLR is >> great for >> complex searches and comes with word filters and alike :) >> > > |
In reply to this post by Valentina Sirkova
Could you outline your approach how you acheived the integration of
solr/lucene? 2009/3/27 madppiper <[hidden email]> > > On my application I have integrated SOLR into the system. SOLR is great for > complex searches and comes with word filters and alike :) > -- > View this message in context: > http://www.nabble.com/Smart-search-tp22731824p22737332.html > Sent from the OFBiz - User mailing list archive at Nabble.com. > > |
Free forum by Nabble | Edit this page |