example_demo1.html 8.72 KB
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Multi Tier Annotation Search</title>
    <script type="text/javascript" src="./js/jquery-3.1.1.min.js"></script>
    <script type="text/javascript" src="./js/solr.js"></script>
    <link rel="stylesheet" type="text/css" href="css/style.css">
  </head>
  <body>
  
    <h1>Multi Tier Annotation Search - example demo1</h1>
       
    <div>
      Go to <a href="index.html">main page</a>.
    </div>         
    
    <hr noshade /> 
    
    <h3>Create index</h3>
    Post to /solr/demo1/update
    <div class="solr" data-type="json" data-url="/solr/demo1/update?wt=json&commitWithin=1000">
      <div class="post"><textarea data-autoresize>[{ "id": "1","author":"Nicolaas Beets","title":"Een onaangenaam mens in de Haarlemmerhout","text":"folia-samples/beets1.xml" },
{ "id": "2","author":"Nicolaas Beets","title":"Een oude kennis","text":"folia-samples/beets2.xml" },
{ "id": "3","author":"Nicolaas Beets","title":"Varen en Rijden","text":"folia-samples/beets3.xml" }]</textarea></div>
      <input class="button post" type="button" value="create index" />
      <input class="button reset" type="button" value="reset" />
      <div class="output"></div>
      <div class="error"></div>
    </div>
    
    <hr noshade /> 
    
    <h3>Empty index</h3>
    Post to /solr/demo1/update
    <div class="solr" data-type="json" data-url="/solr/demo1/update?wt=json&commitWithin=1000">
      <div class="post"><textarea data-autoresize>{
  "delete": {
    "query": "*:*"
  }
}</textarea></div>
      <input class="button post" type="button" value="delete index" />
      <input class="button reset" type="button" value="reset" />
      <div class="output"></div>
      <div class="error"></div>
    </div>
    
    <hr noshade /> 
    
    <h3>Query</h3>
    
    <div>
      Search for everything - classic; post to /solr/demo1/select
      <div class="solr" data-type="post" data-url="/solr/demo1/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q=*:*</textarea></div>
        <input class="button post" type="button" value="post" />
        <input class="button reset" type="button" value="reset" />
        <div class="output"></div>
        <div class="error"></div>
      </div>
    </div>
    
    <br />
    
    <div>
      Search for 'spoorwegen' - classic; post to /solr/demo1/select
      <div class="solr" data-type="post" data-url="/solr/demo1/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q=text:spoorwegen</textarea></div>
        <input class="button post" type="button" value="post" />
        <input class="button reset" type="button" value="reset" />
        <div class="output"></div>
        <div class="error"></div>
      </div>
    </div>
    
    <br />
    
    <div>
      Search for 'spoorwegen' - corpus query language (cql); post to /solr/demo1/select
      <div class="solr" data-type="post" data-url="/solr/demo1/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q={!mtas_cql field="text" query="[t=\"spoorwegen\"]"}</textarea></div>
        <input class="button post" type="button" value="post" />
        <input class="button reset" type="button" value="reset" />
        <div class="output"></div>
        <div class="error"></div>
      </div>
    </div>
    
    <hr noshade /> 
    
    <h3>Basic stats</h3>
    
    <div>
	    Get the number of positions; post to /solr/demo1/select
	    <div class="solr" data-type="post" data-url="/solr/demo1/select?indent=true&wt=json">
	      <div class="post"><textarea data-autoresize>q=*:*&rows=0&mtas=true&mtas.stats=true&mtas.stats.positions=true&mtas.stats.positions.0.key=number of positions&mtas.stats.positions.0.field=text&mtas.stats.positions.0.type=all</textarea></div>
	      <input class="button post" type="button" value="post" />
	      <input class="button reset" type="button" value="reset" />
        <div class="output"></div>
	      <div class="error"></div>
	    </div>
	  </div>
	  
	  <br />
	  
	  <div>
      Get the number of tokens; post to /solr/demo1/select
      <div class="solr" data-type="post" data-url="/solr/demo1/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q=*:*&rows=0&mtas=true&mtas.stats=true&mtas.stats.tokens=true&mtas.stats.tokens.0.key=number of tokens&mtas.stats.tokens.0.field=text&mtas.stats.tokens.0.type=all</textarea></div>
        <input class="button post" type="button" value="post" />
        <input class="button reset" type="button" value="reset" />
        <div class="output"></div>
        <div class="error"></div>
      </div>
    </div>  
    
    <br />
    
    <div>
      Get the number of nouns; post to /solr/demo1/select
      <div class="solr" data-type="post" data-url="/solr/demo1/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q=*:*&rows=0&mtas=true&mtas.stats=true&mtas.stats.spans=true&mtas.stats.spans.0.key=number of nouns&mtas.stats.spans.0.field=text&mtas.stats.spans.0.type=all&mtas.stats.spans.0.query.0.type=cql&mtas.stats.spans.0.query.0.value=[pos="N"]&mtas.stats.spans.0.function.0.key=fraction of nouns&mtas.stats.spans.0.function.0.expression=$q0/$n&mtas.stats.spans.0.function.0.type=all</textarea></div>
        <input class="button post" type="button" value="post" />
        <input class="button reset" type="button" value="reset" />
        <div class="output"></div>
        <div class="error"></div>
      </div>
    </div> 
    
    <hr noshade /> 
    
    <h3>Kwic</h3>
    
    Keyword in Context while searching for 'spoorwegen'; post to /solr/demo1/select 
    
    <div>
      <div class="solr" data-type="post" data-url="/solr/demo1/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q=text:spoorwegen&mtas=true&mtas.kwic=true&mtas.kwic.0.field=text&mtas.kwic.0.query.type=cql&mtas.kwic.0.query.value=[t="spoorwegen"]&mtas.kwic.0.prefix=t,pos,lemma&mtas.kwic.0.output=hit&mtas.kwic.0.left=2&mtas.kwic.0.right=3&mtas.kwic.0.number=2&mtas.kwic.0.start=0</textarea></div>
        <input class="button post" type="button" value="post" />
        <input class="button reset" type="button" value="reset" />
        <div class="output"></div>
        <div class="error"></div>
      </div>
    </div> 
    
    <hr noshade /> 
    
    <h3>Termvector</h3>
    
    Termvector of t_lc with regexp [a-z]{5,*} for documents containing 'spoorwegen'; post to /solr/demo1/select 
    
    <div>
      <div class="solr" data-type="post" data-url="/solr/demo1/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q=text:spoorwegen&mtas=true&mtas.termvector=true&mtas.termvector.0.field=text&mtas.termvector.0.prefix=t_lc&mtas.termvector.0.key=termvector on t_lc&mtas.termvector.0.type=n,sum,mean&mtas.termvector.0.sort.type=sum&mtas.termvector.0.sort.direction=desc&mtas.termvector.0.number=20&mtas.termvector.0.regexp=[a-z]{5,}</textarea></div>
        <input class="button post" type="button" value="post" />
        <input class="button reset" type="button" value="reset" />
        <div class="output"></div>
        <div class="error"></div>
      </div>
    </div>
    
    <hr noshade /> 
    
    <h3>Group</h3>
    
    Group t_lc for adjectives within sentences containing a word with lemma 'spoorweg'; post to /solr/demo1/select 
    
    <div>
      <div class="solr" data-type="post" data-url="/solr/demo1/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q={!mtas_cql field="text" query="[lemma=\"spoorweg\"]"}&mtas=true&mtas.group=true&mtas.group.0.field=text&mtas.group.0.query.type=cql&mtas.group.0.query.value=([pos="ADJ"]) within (<s/> containing [lemma="spoorweg"])&mtas.group.0.grouping.hit.inside.prefixes=t_lc</textarea></div>
        <input class="button post" type="button" value="post" />
        <input class="button reset" type="button" value="reset" />
        <div class="output"></div>
        <div class="error"></div>
      </div>
    </div>
    
    <hr noshade /> 
    
    <h3>Prefixes</h3>
    
    Available prefixes; post to /solr/demo1/select 
    
    <div>
      <div class="solr" data-type="post" data-url="/solr/demo1/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q=*:*&rows=0&mtas=true&mtas.prefix=true&mtas.prefix.0.field=text&mtas.prefix.0.key=prefixes</textarea></div>
        <input class="button post" type="button" value="post" />
        <input class="button reset" type="button" value="reset" />
        <div class="output"></div>
        <div class="error"></div>
      </div>
    </div>
    
    <hr noshade />
    
    <div>
      Go to <a href="index.html">main page</a>.
    </div>
    
  </body>
</html>