metamorph index

Post Reply
jlin
Posts: 27
Joined: Fri Apr 06, 2001 4:03 pm

metamorph index

Post by jlin »

Hi,
I kept getting this error message. Here's the background:

Table: items
id int
Name varchar
Description varchar

Index:
create metamorph inverted index xitems1 on items(Name\Description);

Here's what's in my code:
<SQL "select Name from items where Name\Description likep 'shoes' order by Name">
<SQL>

The sql statement returns the result sorted alphabetically, but it always give me the following error messages:

<!-- 115 /inny/innydl:122: Field Name non-existent -->
<!-- 200 /inny/innydl:122: Can't handle ORDER BY with compound index -->

Did I do anything wrong?

Thanks!
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

metamorph index

Post by John »

No, you didn't do anything wrong. Are you sure that is the index you have? Those are not error messages, but informational messages, indicating that the ORDER BY was not able to use the compound index.
John Turnbull
Thunderstone Software
jlin
Posts: 27
Joined: Fri Apr 06, 2001 4:03 pm

metamorph index

Post by jlin »

Hi John,

I actually have one field called List_ID in the items table.

So the exact index I have is:

create metamorph inverted index xitems1 on items(Name\Description,List_ID);

When I do "select Name from items where Name\Description likep 'shoes' and List_ID=2 order by Name", everything seems to be fine, those informational messages are not showing up.

Thanks for the fast response!
bart
Posts: 251
Joined: Wed Apr 26, 2000 12:42 am

metamorph index

Post by bart »

You should probably not be using likep with an "order by" (unless you really know why you're doing it). Using "like" instead of "likep" would be more correct and save CPU time in most cases.
jlin
Posts: 27
Joined: Fri Apr 06, 2001 4:03 pm

metamorph index

Post by jlin »

That does make sense, thanks!
Post Reply