Hi folks,
Is there a way to do concatenation using entity engine? If not, how hard would it be to implement? Maybe I can take a shot at it. I'm researching the options for doing searches on several string fields and the only practical way I can solve the problem is to concatenate the fields in a defined order and do a LIKE match. This is the only search space that seems to work for the intended feature: To allow a search on firstName + lastName so that if the user types in "Leon Tor", the result set conains "Leon Tor%" and not "Leon Alpha" or any results where lastName doesn't start with "Tor". - Leon |
Leon, Have you tried a view-entity (or DynamicViewEntity) with a complex- alias? -David On Sep 16, 2006, at 12:23 PM, Leon Torres wrote: > Hi folks, > > Is there a way to do concatenation using entity engine? If not, > how hard would it be to implement? Maybe I can take a shot at it. > > I'm researching the options for doing searches on several string > fields and the only practical way I can solve the problem is to > concatenate the fields in a defined order and do a LIKE match. > This is the only search space that seems to work for the intended > feature: To allow a search on firstName + lastName so that if the > user types in "Leon Tor", the result set conains "Leon Tor%" and > not "Leon Alpha" or any results where lastName doesn't start with > "Tor". > > - Leon |
Nope, I'll take a look and see if it solves my problem. If it does, I'll report
back for the benefit of others. :-) Thanks, Leon David E Jones wrote: > > Leon, > > Have you tried a view-entity (or DynamicViewEntity) with a complex-alias? > > -David > > > On Sep 16, 2006, at 12:23 PM, Leon Torres wrote: > >> Hi folks, >> >> Is there a way to do concatenation using entity engine? If not, how >> hard would it be to implement? Maybe I can take a shot at it. >> >> I'm researching the options for doing searches on several string >> fields and the only practical way I can solve the problem is to >> concatenate the fields in a defined order and do a LIKE match. This >> is the only search space that seems to work for the intended feature: >> To allow a search on firstName + lastName so that if the user types in >> "Leon Tor", the result set conains "Leon Tor%" and not "Leon Alpha" or >> any results where lastName doesn't start with "Tor". >> >> - Leon > > |
In reply to this post by David E Jones-2
Hey,
I found that simple concatenate works with complex-alias. However my problem is more than complex-alias can handle. The query in postgresql is as follows, select coalesce(pg.group_name,'') || ' ' || coalesce(per.first_name,'') || ' ' || coalesce(per.last_name,'') from party p left outer join party_group pg on (p.party_id = pg.party_id) left outer join person per on (p.party_id = per.party_id); I can't see how to concatenate spaces and include the coalesce function. I guess I'm stuck with using an EntityListIterator and doing the matching by hand in java. It should work ok for now until the search space becomes huge, in which case I'm going to need to do the coalesce SQL with an index. Basically, this limits the ability to do on the fly searches of several fields of data at once. It's important for autocomplete functionality, especially when searching for parties (and hopefully only parties), but it is not critical. - Leon David E Jones wrote: > > Leon, > > Have you tried a view-entity (or DynamicViewEntity) with a complex-alias? > > -David > > > On Sep 16, 2006, at 12:23 PM, Leon Torres wrote: > >> Hi folks, >> >> Is there a way to do concatenation using entity engine? If not, how >> hard would it be to implement? Maybe I can take a shot at it. >> >> I'm researching the options for doing searches on several string >> fields and the only practical way I can solve the problem is to >> concatenate the fields in a defined order and do a LIKE match. This >> is the only search space that seems to work for the intended feature: >> To allow a search on firstName + lastName so that if the user types in >> "Leon Tor", the result set conains "Leon Tor%" and not "Leon Alpha" or >> any results where lastName doesn't start with "Tor". >> >> - Leon > > |
Free forum by Nabble | Edit this page |