質問

I have a search working that combines the results of multiple cfsearch'es using categories. The collection data is from a query, a view in a mssql db.

The problem is that the search requires multiple cfsearch'es, each taking time to process. They also all process individually, so the results are not combined by Verity, but by QoQ unioning.

So my question is this: Can I search multiple categories, using AND, OR or NOT, each category containing specific words?

Categories: FRUIT, VEGETABLES, DAIRY Search terms: orange, apple, celery, yogurt, ford, basketball

What I want is to search criteria like this:

basketball AND FRUIT<CONTAINS>orange AND VEGETABLES<CONTAINS>celery

So my tag would be:

<cfsearch type="explicit" collection="myCollection" name="mySearch"
    criteria="basketball AND FRUIT<CONTAINS>orange AND VEGETABLES<CONTAINS>celery">

I'm searching FRUIT for orange, VEGETABLES for celery and all categories for basketball.

I can't get a simple explicit search to work either:

<cfsearch type="explicit" collection="myCollection" name="mySearch"
    criteria="FRUIT<CONTAINS>orange">

But when I search

<cfsearch type="explicit" collection="myCollection" name="mySearch"
        criteria="<WORD>orange">

I get a result of which the category is FRUIT.

Any help or direction for explicit searching will help. I've looked at the Adobe stuff, but I either missed something or it doesn't explain how to do this (or if it's not possible).

Thanks

役に立ちましたか?

解決

What I found is that Verity does not seem to search categories when performing an explicit search.

I had to convert my category column to a cf_customN column, then match on that. I'm already using cf_custom1, so I used cf_custom2 for my categories.

My criteria is now building as:

(CF_CUSTOM2<MATCHES>fruit AND <ACCRUE>('orange','apple')) OR
(<ACCRUE>('basketball')) OR 
(CF_CUSTOM2<MATCHES>vegetables AND <ACCRUE>('celery'))

The reason I'm wrapping the search parameters in quotes is due to reserved words. If you search any word Verity uses (such as 'word'), and don't wrap it in quotes, the search breaks.

I hope this saves someone else some time. Thanks for reading.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top