What kind of index to use?

User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

What kind of index to use?

Post by mark »

Yes, if you want to combine the likep search with a date restriction you should add the date field to the compound index. If you want to just search by date you should create a separate regular index on date.
Faiz
Posts: 109
Joined: Wed Jan 10, 2001 1:29 pm

What kind of index to use?

Post by Faiz »

I have a problem. The virtual field Url\Title\Description\Keywords\Body searches not only documents containing keywords but also Urls containing keywords. For example if I search for the word "training", not only all the documents containing "training" but also all the Urls that have training in them and have the extension .pdf are displayed.
Is it possible to search only on Title\Description\Keywords\Body for the keyword and bring up only PDF documents using the above index expression?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

What kind of index to use?

Post by mark »

Create an index on Title\Description\Keywords\Body and another on Url. Then search the independantly with an "and" in your where clause:
where Title\Description\Keywords\Body likep $query
and Url like '.pdf'

When you index Url by itself you'll want the first expression you were using with ">>=" at the end instead of "\F\n".
Faiz
Posts: 109
Joined: Wed Jan 10, 2001 1:29 pm

What kind of index to use?

Post by Faiz »

Thanx. Shall I create a metmorph normal index on Url or just a normal index? Is it going to affect $indexcount?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

What kind of index to use?

Post by mark »

like and likep both use metamorph indices. < > = matches use normal indices. Yes, $indexcount will likely be higher than the actual number of hits unless you set maxlinearrows to 0.
Post Reply