Re: Simple Search
Re: Simple Search
- Subject: Re: Simple Search
- From: Owen McKerrow <email@hidden>
- Date: Mon, 17 Jul 2006 08:30:40 +1000
Hi David,
What kind of search are you trying to do ? Is the display group using
a fetch spec you built in modler ? Is it using bindings one of the
query methods ? From your error statment it looks like your using key
value coding. Basically the issue is that you entity Document doe not
have an attribute in it called simpleSearch. So when it try's to ask
for the value of "simpleString" it says I don't know anything about a
simple string.
As author and title are different attributes in your Document, you
don't join them together to search over them. You use a "AND" or an
"OR" search.
And this is where its important to know what kind of search you are
doing.
Owen McKerrow
WebMaster, emlab
Ph : +61 02 4221 5517
http://emlab.uow.edu.au
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - -
"I like the way this project has somehow, against all common sense,
got itself made."
- Peter Jackson, "The Lord of The Rings"
On 15/07/2006, at 10:03 AM, David Holt wrote:
I am using DisplayGroups which make queries on individual
attributes very easy.
I would like to provide a simple search where one text field
returns a search on a concatenation of several attributes of the
entity. I just tried putting the following code in my EO to try
this concept out (title and author are attributes in the entity):
public String simpleSearch() {
String author = author();
String title = title();
String simpleSearch;
if ((author != null) && (!author.equals(""))) {
simpleSearch = author + " " + title;
}
else {
simpleSearch = title;
}
return simpleSearch;
}
When I try and do a queryMatch on the simpleSearch field I get an
error:
java.lang.IllegalStateException: sqlStringForKeyValueQualifier:
attempt to generate SQL for
com.webobjects.eocontrol.EOKeyValueQualifier (simpleSearch
caseinsensitivelike '*test*') failed because attribute identified
by key 'simpleSearch' was not reachable from from entity 'Document'
I assume this is because the attribute "simpleSearch" is not
actually in the database. Is there a better strategy for searching
concatenated fields using DisplayGroups?
Thanks,
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40uow.edu.au
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden