Note that there are some explanatory texts on larger screens.

plurals
  1. POCreate and read tree data structure from json string dynamically
    primarykey
    data
    text
    <p>I'm trying to develop a dynamic query builder for days. But I'm having a problem with building it.</p> <p>What I'm reviving is a json like this.</p> <pre><code>{"category":"Case Law","query":{"AND":{"Year":{"having":"","exact":"","any":"","none":""},"AND":{"Report":{"having":"","exact":"","any":"","none":""},"Citation":{"having":"","exact":"","any":"","none":""}}}}} </code></pre> <p>Here is it in much readable way</p> <pre><code>Array ( [category] =&gt; Case Law [query] =&gt; Array ( [OR] =&gt; Array ( [Year] =&gt; Array ( [having] =&gt; some [exact] =&gt; values [any] =&gt; might [none] =&gt; have ) [AND] =&gt; Array ( [Report] =&gt; Array ( [having] =&gt; [exact] =&gt; [any] =&gt; [none] =&gt; ) [Citation] =&gt; Array ( [having] =&gt; [exact] =&gt; [any] =&gt; [none] =&gt; ) ) ) ) ) </code></pre> <ul> <li>this json can change according to the user inputs(can have more depth or less).</li> <li>what I'm trying to do is create a search query for apache lucene...(for the moment lets assume that leaf values are just strings.)</li> </ul> <p>It <strong>must be</strong> something like this(What I need)</p> <blockquote> <p>(Year:another values OR (Report:some valeus AND Citation:some valeues))</p> </blockquote> <p>I tried with Jettison library and used DefaultMutableTreeNode to create the tree structure . But it didn't work as I expected.Then i tried whit recursive functions and it also didn't worked </p> <p>I want to is it possible to create this kind of thing. If yes how to do.</p> <p>Your attempt is highly appreciated! Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload