This documentation applies to the general "Search" box that is available on the Explore and Verification pages. (It does not apply to the filter boxes that appear at the tops of the columns when looking at a grid of records.) These pages use Indicia ElasticSearch (ES) technology to allow fast querying of large numbers of records.
By default, the Search box operates across all fields in the ES index. If you type in a word into the Search box the system will look for any instance of that word, in any part of any record.
Consider this search:
That will retrieve records of Crows, records made by Fred Crow, records made at Crow Point and many more.
Searches can be made more precise by restricting them to particular fields within the records. Below are some examples of how to do this. In each case the starting point if to add the name of the ES field that you wish to search. For example to restrict the search to records made by people called Crow, use this:
That will retrieve records by anyone with the word 'Crow' in their name. (Only the whole word – it wouldn't retrieve records for someone with the surname 'Crowmore'.)
To further restrict records to those made by Fred Crow, you need to quote the search string:
But beware, this will not retrieve records where the name is represented as "Crow, Fred" for example. When you enclose a string in quotes, only exact matches are retrieved.
If more than one word is used in a search term and these are not enclosed in quotes, then the search will treat this as an implicit OR operation. Consider this search:
That will retrieve all records where either the word 'Smithills' or 'Estate', appears in a field.
To retrieve only those with the phrase 'Smithills Estate' in a field, use this search:
And to be absolutely sure that the search was restricted to the Location field, you could use this:
For information on using explicit OR and AND operators, see 'combining values' below.
To search for records from 2020 you could enter this search term:
That will indeed retrieve all records created in 2020, but it will also retrieve all records last updated in 2020, even where the actual record was made many years before. It will also retrieve records where '2020' appears in any field - date or otherwise, and including the comment fields. So it is good practice to qualify searches on dates with the name of a field, like this for example:
That search will only retrieve records for the year 2020. To specify a particular month in a year, you must specify a field like this:
That will retrieve all records for May 2019. (Note that the search term '2019-05' on its own - i.e. without the ES field name - will fail.) A full date is specified similarly:
That will only retrieve records for 11th May 2019. The search terms above that specify only a year or a month within a year are implicit date ranges since all records with a value for event.date_start that fall within that year (or month) will be retrieved. But date ranges can also be specified explicity. For example:
event.date_start:[2018-12 TO 2019-02]
That search will retrieve any records made between December 2018 and February 2019 inclusive. Note the uppercase 'TO' - lowercase won't do. Consider another:
event.date_start:[2018-12-03 TO 2018-12-05]
That search will retrieve any records made between 3rd and 5th December 2018 inclusive.
Remember that iRecord/Indicia actually stores both a start date and and end date for records. For records that specify a single day - the majority of records - the start date and end date are the same. Consider this search:
event.date_end:[2018-12-03 TO 2018-12-05]
Notice that it is searching on the field event.date_end, unlike the previous search on event.date_start, but the results are quite likely to be the same in this case since a search over such a short time range is likely to retrieve only records that specify a single day and the start and end dates for these are the same.
But sometimes you might want to retrieve records that have been specified for a date range - in those cases you will likely want to carefully distinguish between start and end date and probably use a combined search term that specifies both the start and end dates, e.g:
event.date_start:2018-01-01 AND event.date_end:2018-12-31
That search will retrieve all records for which the date was specified as the range 1st Jan 2018 to 31st December 2018 - in other words the year 2018. (For more on the logical AND operator see the next section.) Note the difference between this and a search like 'event.date_start:2018': whilst the latter will retrieve any record whose start date is somewhere in the year 2018, the search above will only retrieve records where the start date is 1st Jan 2018 and the end date 31st December 2018.
You can use a wildcard in a date range. For example:
event.date_start:[* To 2016]
That would retrieve all records before, and including 2016.
Combining search terms
Search terms can be combined with the logical operators AND and OR (they must be specified in uppercase). For example:
event.recorded_by:"Fred Crow" AND event.date_start:2019
That search will retrieve all records made by Fred Crow in 2019 (where the name is specified as 'Fred Crow'). Or works like this:
event.recorded_by:("Fred Crow" OR "Crow, Fred")
That will retrieve records by Fred Crow whether the name is specified as 'Fred Crow' or 'Crow, Fred' in the ES index. You can combine ORs and ANDs
event.recorded_by:("Fred Crow" OR "Crow, Fred") AND event.date_start:2019
That will retrieve all records made by Fred Crow in 2019, whether the name is specified as 'Fred Crow' or 'Crow, Fred'.
Available search fields
A full list and description of the available search fields is available for sample fields and occurrence fields. There are a large number of fields, derived from all sorts of information about the record including the survey it belongs to, the website or app it came from etc.
Below are just a few of them:
- location.output_sref (use this for grid reference)
If you are really curious about the ElasticSearch search syntax further details can be found via web resources such as this ElasticsearchGuide. Note however that this a general ElasticSearch help page - it is not geared to our iRecord/Indicia implementation. However, you might find some useful information there if you want to do a search which is beyond the scope of this help page.