example_demo4.html 11.6 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 demo4 (CHAT examples)</h1>
       
    <div>
      Go to <a href="index.html">main page</a>.
    </div>         
    
    <hr noshade /> 
    
    <h3>Create index</h3>
    Post to /solr/demo4/update
    <div class="solr" data-type="json" data-url="/solr/demo4/update?wt=json&commitWithin=1000">
      <div class="post"><textarea data-autoresize>[{ "id": "1","type": "chat","author":"Julie","title":"02-0_11_18","text":"chat-samples/Julie/02-0_11_18.xml" },
{ "id": "2","type": "chat","author":"Julie","title":"09-1_03_16","text":"chat-samples/Julie/09-1_03_16.xml" },
{ "id": "3","type": "chat","author":"Julie","title":"10-1_04_23","text":"chat-samples/Julie/10-1_04_23.xml" },
{ "id": "4","type": "chat","author":"Julie","title":"11-1_06_04","text":"chat-samples/Julie/11-1_06_04.xml" },
{ "id": "5","type": "chat","author":"Julie","title":"13-1_07_26","text":"chat-samples/Julie/13-1_07_26.xml" },
{ "id": "6","type": "chat","author":"Julie","title":"14-1_09_16","text":"chat-samples/Julie/14-1_09_16.xml" },
{ "id": "7","type": "chat","author":"Julie","title":"16-1_11_11","text":"chat-samples/Julie/16-1_11_11.xml" },
{ "id": "8","type": "chat","author":"Julie","title":"17-2_00_10","text":"chat-samples/Julie/17-2_00_10.xml" },
{ "id": "9","type": "chat","author":"Julie","title":"19-2_01_23","text":"chat-samples/Julie/19-2_01_23.xml" },
{ "id": "10","type": "chat","author":"Julie","title":"25-2_06_22","text":"chat-samples/Julie/25-2_06_22.xml" },
{ "id": "11","type": "chat","author":"Julie","title":"41-4_08_29","text":"chat-samples/Julie/41-4_08_29.xml" },
{ "id": "12","type": "chat","author":"Julie","title":"42-5_03_19","text":"chat-samples/Julie/42-5_03_19.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/demo4/update
    <div class="solr" data-type="json" data-url="/solr/demo4/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 'anniversaire' - classic; post to /solr/demo4/select
      <div class="solr" data-type="post" data-url="/solr/demo4/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q=text:*anniversaire*</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 'anniversaire' - corpus query language (cql); post to /solr/demo4/select
      <div class="solr" data-type="post" data-url="/solr/demo4/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q={!mtas_cql field="text" query="[w=\"anniversaire\"]"}</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/demo4/select
	    <div class="solr" data-type="post" data-url="/solr/demo4/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/demo4/select
      <div class="solr" data-type="post" data-url="/solr/demo4/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/demo4/select
      <div class="solr" data-type="post" data-url="/solr/demo4/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.c="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 'anniversaire'; post to /solr/demo4/select 
    
    <div>
      <div class="solr" data-type="post" data-url="/solr/demo4/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q={!mtas_cql field="text" query="[w=\"anniversaire\"]"}&mtas=true&mtas.kwic=true&mtas.kwic.0.field=text&mtas.kwic.0.query.type=cql&mtas.kwic.0.query.value=[w="anniversaire"]&mtas.kwic.0.prefix=w&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> 
    
    <br />
    
    Keyword in Context while searching for 'fête' followed by 'anniversaire' within 5 positions; post to /solr/demo4/select 
    
    <div>
      <div class="solr" data-type="post" data-url="/solr/demo4/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q={!mtas_cql field="text" query="[w=\"fête\"][]{0,4}[w=\"anniversaire\"]"}&mtas=true&mtas.kwic=true&mtas.kwic.0.field=text&mtas.kwic.0.query.type=cql&mtas.kwic.0.query.value=[w="fête"][]{0,4}[w="anniversaire"]&mtas.kwic.0.prefix=w,stem,pos.c,u,u.role,u.name,u.sex&mtas.kwic.0.output=token&mtas.kwic.0.left=0&mtas.kwic.0.right=0&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 w with regexp [a-z]{5,*} for documents containing 'anniversaire'; post to /solr/demo4/select 
    
    <div>
      <div class="solr" data-type="post" data-url="/solr/demo4/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q={!mtas_cql field="text" query="[w=\"anniversaire\"]"}&mtas=true&mtas.termvector=true&mtas.termvector.0.field=text&mtas.termvector.0.prefix=w&mtas.termvector.0.key=termvector on w&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 w for any verb followed by 'pas' en preceded by 'ne'; post to /solr/demo4/select 
    
    <div>
      <div class="solr" data-type="post" data-url="/solr/demo4/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q=*:*&rows=0&mtas=true&mtas.group=true&mtas.group.0.field=text&mtas.group.0.query.type=cql&mtas.group.0.query.value=([pos.c="v"] followedby [w="pas"]) precededby [w="ne"]&mtas.group.0.grouping.hit.inside.prefixes=w</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/>
    
    Group w for any verb followed by 'pas' en preceded by 'ne' and used by Mother; post to /solr/demo4/select 
    
    <div>
      <div class="solr" data-type="post" data-url="/solr/demo4/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q=*:*&rows=0&mtas=true&mtas.group=true&mtas.group.0.field=text&mtas.group.0.query.type=cql&mtas.group.0.query.value=(([pos.c="v"] followedby [w="pas"]) precededby [w="ne"]) within <u.role="Mother">&mtas.group.0.grouping.hit.inside.prefixes=w</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/>
    
    Group u.role and w for any verb followed by 'pas' en preceded by 'ne'; post to /solr/demo4/select 
    
    <div>
      <div class="solr" data-type="post" data-url="/solr/demo4/select?indent=true&wt=json">
        <div class="post"><textarea data-autoresize>q=*:*&rows=0&mtas=true&mtas.group=true&mtas.group.0.field=text&mtas.group.0.query.type=cql&mtas.group.0.query.value=([pos.c="v"] followedby [w="pas"]) precededby [w="ne"]&mtas.group.0.grouping.hit.inside.prefixes=u.role,w</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/demo4/select 
    
    <div>
      <div class="solr" data-type="post" data-url="/solr/demo4/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>