Combine search exclusions in json

Is there a way to get the meta &ex_q=Occupation:Researcher only for* (se image of label below) in this json query:

What I want to accomplish is to only get hits from the url:s included in this label but pages in this url* MUST have meta <meta name="Occupation" content="Researcher" />

I can also lift that url out into another label but is it possible to divide a json question and set the meta condition only for one label?

How about adding url%3A"*"?

I dont see how that could help? In the label above I want to show results for every url but only pages with <meta name="Occupation" content="Researcher" /> for url* in that label. Is there a way to do that?

Did you try url%3A"*" as a query?
If you put a value of the meta tag to a custom field, such as occupation, the query is like

If I try this:*%22&num=100&start=0&lang=sv&sort=score.desc

I only get results from the label forskning_sv and not from the url. I have removed the url* from the label. Is that correct or does the url have to be in the label?

I might not understand your question correctly…*%22 is a query to search documents with occupation:Researcher in* .

I want to search for a word (in this case “anders”) on pages included in a label (forskning_sv) AND on pages wich url:s starts with* but ONLY if pages (in*) contains<meta name="Occupation" content="Researcher" />

That is: searchword “anders” in label forskning_sv AND in url* IF those pages contains <meta name="Occupation" content="Researcher" />

I think the query is q=andres+label%3Aforskning_sv+url%3A"*"+occupation%3AResearcher.

These two works:

But combined it does not work:
/json/?q=anders+label%3Aforskning_sv+url%3A"*"+Occupation%3AResearcher* is not in label forskning_sv

pages included in a label (forskning_sv) AND on pages wich url:s starts with*

It looks OR, not AND…
So, your expected query may be:

anders (label:forskning_sv OR (url:"*" Occupation:Researcher))

That worked, Thank you!


I’m picking up this thread again. My question is: Is it possible to condition an url in a LABEL? I want to include pages under a specific url IF they contain meta: <meta name="Organisation" content="ub" />

Like this argument but inside the label not in the query:

url:"*" Organisation:ub seems to be correct.

So I can put this in a label and get results from pages with that url and only if they contain this meta?

Label does not have a feature to specify a condition as a query…

Is there a way to do that on the crawl/ingest side not the query side.

You might be able to use field.script., such as field.script.label, in Config Parameters. I think the other solution is to modify FessXpathTransformer class.