PATRIC3 / patric3_website

Legacy PATRIC Website (JBoss Portal Version)
MIT License
5 stars 2 forks source link

bracket searches in solr queries not working #347

Open nconrad opened 9 years ago

nconrad commented 9 years ago

Making a ticket for @dmachi .

I'm not able to query for square brackets. Users want to be able to search for strings with compartments such as "h2[e]".

https://www.patricbrc.org/api/model_reaction/?select(name,id,definition,deltag,deltagerr,direction)&or(eq(name,*%5B*),eq(id,*%5B*),eq(definition,*%5B*),eq(deltag,*%5B*),eq(deltagerr,*%5B*),eq(direction,*%5B*))&http_accept=application/solr+json

I'm also not sure how to search for parens (, ). The following gives a 502.

https://www.patricbrc.org/api/model_reaction/?http_accept=application/solr+json&select(name,id,definition,deltag,deltagerr,direction)&or(eq(name,*%28*),eq(id,*%28*),eq(definition,*%28*),eq(deltag,*%28*),eq(deltagerr,*%28*),eq(direction,*%28*))&limit(10)&sort(+id)

dmachi commented 9 years ago

Here are working query with brackets and parens in them:

for query [c]

https://www.beta.patricbrc.org/api/model_reaction/?http_accept=application/solr+json&limit(1)&eq(definition,*%5C%5Bc%5C%5D*)

For query (2)

https://www.beta.patricbrc.org/api/model_reaction/?http_accept=application/solr+json&limit(1)&eq(definition,*\(2)*)

dmachi commented 9 years ago

Also when searching for a string with a colon such as ModelSEED:rxn05785, It needs to be escaped and encoded like:

https://www.beta.patricbrc.org/api/model_reaction/?http_accept=application/solr+json&limit(1)&eq(aliases,ModelSEED%5C%3Arxn05785)

Note that in general for the aliases, this shouldn't be needed as just searching for the aliase itself is normally what you want:

https://www.beta.patricbrc.org/api/model_reaction/?http_accept=application/solr+json&limit(1)&eq(aliases,rxn05785)

hyoo commented 7 years ago

@nconrad is this resolved?