Combine search exclusions in json

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

https://sok.oru.se/json/?q=anders&fields.label=forskning_sv&num=10&start=0&lang=sv

What I want to accomplish is to only get hits from the url:s included in this label but pages in this url www.oru.se/personal/.* 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"https%3A%2F%2Fwww.oru.se%2Fpersonal%2F*"?

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 www.oru.se/personal/.* in that label. Is there a way to do that?

Did you try url%3A"https%3A%2F%2Fwww.oru.se%2Fpersonal%2F*" as a query?
If you put a value of the meta tag to a custom field, such as occupation, the query is like
q=occupation:Researcher+url%3A"https%3A%2F%2Fwww.oru.se%2Fpersonal%2F*".

If I try this: https://sok-test.oru.se/json/?q=anders&fields.label=forskning_sv&q=occupation:Researcher+url%3A%22https%3A%2F%2Fwww.oru.se%2Fpersonal%2F*%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 www.oru.se/personal/.* from the label. Is that correct or does the url have to be in the label?

I might not understand your question correctly…
q=occupation:Researcher+url%3A%22https%3A%2F%2Fwww.oru.se%2Fpersonal%2F*%22 is a query to search documents with occupation:Researcher in www.oru.se/personal/.* .

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 www.oru.se/personal/.* but ONLY if pages (in www.oru.se/personal/.*) contains<meta name="Occupation" content="Researcher" />

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

I think the query is q=andres+label%3Aforskning_sv+url%3A"https%3A%2F%2Fwww.oru.se%2Fpersonal%2F*"+occupation%3AResearcher.

These two works:
/json/?q=anders+url%3A"https%3A%2F%2Fwww.oru.se%2Fpersonal%2F*"+Occupation%3AResearcher
and
/json/?q=anders+label%3Aforskning_sv

But combined it does not work:
/json/?q=anders+label%3Aforskning_sv+url%3A"https%3A%2F%2Fwww.oru.se%2Fpersonal%2F*"+Occupation%3AResearcher

https%3A%2F%2Fwww.oru.se%2Fpersonal%2F* is not in label forskning_sv

pages included in a label (forskning_sv) AND on pages wich url:s starts with www.oru.se/personal/.*

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

anders (label:forskning_sv OR (url:"https://www.oru.se/personal/*" Occupation:Researcher))

That worked, Thank you!

Hi!

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:%22https://www.oru.se/english/employee/*%22%20Organisation:ub)

url:"https://www.oru.se/english/employee/*" 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.