Search

Overview

The Search API allows you to retrieve search results from the CiviX Server legislation repository.

HTTP Example Request

Searches are based on an aspect within the CiviX Server API. A list of aspects can be found in the Content API

In this example we will search the "complete" aspect for every occurrence of "water":

http://www.bclaws.ca/civix/search/complete/fullsearch?q=water&s=0&e=20&nFrag=5&lFrag=100

Query Variable Definition

  q  -  The query term that you are searching for.
  s  -  The first hit you wish to return. Note: there cannot be a difference greater than 100 between the first hit and the last hit for performance reasons.
  e  -  The last hit you wish to return. Note: there cannot be a difference greater than 100 between the first hit and the last hit for performance reasons.
  nFrag  -  The number of fragment snippets you want to return. Number must be less than 10 for performance reasons. (Note: May not always return exact number of fragments based on search matrix.)
  lFrag  -  The length that each of the above fragments should be. Number must be less than 200 for performance reasons. (Note: May not always return exact length of fragments based on search matrix.)

HTTP Example XML (Shortened for Brevity)


    <results query="CIVIX_DOCUMENT_ROOT:water">
        <doc hits="1">
            <CIVIX_DOCUMENT_TITLE>1st Edition TLC - Water Protection Act</CIVIX_DOCUMENT_TITLE>
            <CIVIX_DOCUMENT_LOC>-- W --/14_Water Protection Act [RSBC 1996] c. 484/01_Tables of Legislative Changes/60_tlc96484.xml</CIVIX_DOCUMENT_LOC>
            <CIVIX_DOCUMENT_ID>tlc96484</CIVIX_DOCUMENT_ID>
            <CIVIX_INDEX_ID>statreg</CIVIX_INDEX_ID>
            <CIVIX_DOCUMENT_INDEX>true</CIVIX_DOCUMENT_INDEX>
            <CIVIX_DOCUMENT_TYPE>document</CIVIX_DOCUMENT_TYPE>
            <CIVIX_DOCUMENT_PARENT>tlc96484_f</CIVIX_DOCUMENT_PARENT>
            <CIVIX_DOCUMENT_ANCESTORS>tlc96484_f</CIVIX_DOCUMENT_ANCESTORS>
            <CIVIX_DOCUMENT_ANCESTORS>96484</CIVIX_DOCUMENT_ANCESTORS>
            <CIVIX_DOCUMENT_ANCESTORS>901199259</CIVIX_DOCUMENT_ANCESTORS>
            <CIVIX_DOCUMENT_ANCESTORS>statreg</CIVIX_DOCUMENT_ANCESTORS>
            <frag>...
                <b loc="1">Water</b>Protection Act 1996 484 1 am 2003-7-67 12 Mar 2003 (RA) 5</frag>
        </doc>
    </results>
    

This Meta information can then be used to return documents using the Document API