Hi, I often find myself having to analyze an already existing solr query. But when the number of clauses and/or number of nested parentheses reach a certain level I can no longer grasp what the query is about by just a quick glance. Sometimes I can look at the code generating the query, but it might be autogenerated in a complex way, or I might only have access to a log output of the query.
Here is an example query, based on a real query in our system: system:(a) type:(x OR y OR z) date1:[* TO 2019-08-31T06:15:00Z/DAY+1DAYS] ((boolean1:false OR date2:[* TO 2019-08-31T06:15:00Z/DAY-30DAYS])) -date3:[2019-08-31T06:15:00Z/DAY+1DAYS TO *] (((*:* -date4:*) OR date5:* OR date3:[* TO 2019-08-31T06:15:00Z/DAY+1DAYS])) Here I find it quite difficult to what clauses are grouped together (using parentheses). What I tend to do in these circumstances is to copy the query into a simple text editor, and then manually add line breaks and indentation matching the parentheses levels. For the query above, it would result in something like this: system:(a) type:(x OR y OR z) date1:[* TO 2019-08-31T06:15:00Z/DAY+1DAYS] ( (boolean1:false OR date2:[* TO 2019-08-31T06:15:00Z/DAY-30DAYS]) ) -date3:[2019-08-31T06:15:00Z/DAY+1DAYS TO *] ( ((*:* -date4:*) OR date5:* OR date3:[* TO 2019-08-31T06:15:00Z/DAY+1DAYS]) ) But that is a slow process, and I might make a mistake that messes up the interpretation completely. Especially when there are several levels of nested parentheses. Does anyone know of any kind of tool that would help automate this? It wouldn't have to format its output like my example, as long as it makes it easier to see what start and end parentheses belong to each other, preferably using multiple lines and indentation. A java tool would be perfect, because then I could easily integrate it into our existing debugging tools, but an online formatter (like http://jsonformatter.curiousconcept.com) would also be very useful. Regards /Jimi Svenskt Näringsliv behandlar dina personuppgifter i enlighet med GDPR. Här kan du läsa mer om vår behandling och dina rättigheter, Integritetspolicy<https://www.svensktnaringsliv.se/dataskydd/integritet-och-behandling-av-personuppgifter_697219.html?utm_source=sn-email&utm_medium=email>