Set the scope of an input to search two metadata fields

I’m trying to work out how to get a search input to search across two metadata fields. The only way I can get it to work so far has been to map the two fields with the same class name. I’ve worked out I can’t map to the same metadata field more than once.

The issue is that I want to be able to return the value of only one of the fields in the search results.

An example of what I am trying to achieve:

Map to metadata field X
Map to metadata field Y

One search input to search against metadata X and Y

Only return result value from field X

A pre process hook script might be appropriate here. Assuming your input field is named queryXorY, you would need to transform the single value there into logic like:

[X:queryXorY Y:queryXorY]

There’s some examples that are close at:

As for returning the only the ‘X’ metadata values, you could modify your summary field query processor options to include:

-SF=[X,Y] -SM=meta

See also: