Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Timestamp Operations on Fields

WSO2 DAS support supports only the primitive data types in when persisting data, thus . Therefore it does not have a special timestamp daa type as such. For this, user should use a data type for timestamp. The LONG data type should be used when sending timestamp values. In the case of querying these fields as timestamp fields, However, because it is convenient for the user to give values in to query with a string timestamp format, rather than direct long values. The string format for this is "time stamp format instead of querying for a long value which is exactly the same as the actual value, the following string format is supported.  

yyyy-MM-dd HH:mm:ss z",

e.g. ", 2015-01-02 15:22:10 GMT+6".

This value will be is converted to a Unix timestamp long value and will be then used for searching.

Sample Queries
  • The following query can be used to search for a person whose last name is Smith and the date of birth is 2nd of January 2015.
    surname:"Smith" AND birthdate:"2015-01-02" 

  • The following query can be used for a log level WARN which occurred at a time between the time stamps 2015-10-01 01:05:20 and 20.15-12-15 00:00:00.
    log_level: "WARN" AND timestamp: [2015-10-01 01:05:20 TO 2015-12-15 00:00:00]

Search with Multi-Word Values

In Lucene, if a field of type STRING If an attribute of the STRING type is instructed to be indexed, it will be tokenized and indexed, so the field can be searched with each Apache Lucene tokenises and indexes it in a manner that allows you to search by that attribute using individual word values. If the full value must be searched as a whole, and if we consider the target field name is "x", the field we must search would be "_x", which will search for the full value that is given. For example, if we have a field "name" indexed, and if the entry "Will Smith" is stored, among others, we can search for all names which has "Smith", with the following query:-you want to search by the attribute by using the complete attribute value, WSO2 DAS allows the following query to be used for this purpose.

_X:<EXACT_ATTRIBUTE_Value>

Info

In this query, X = Attribute Name

Sample query

If the Name attribute is indexed and a record with Will Smith as the value of the Name attribute is stored:

  • Use the following query to search for all records with Smith as all or part of the value for the Name attribute.
    name:"Smith"

...

  •  
  • Use the following query to search for

...

  • all records where Will Smith is the exact value for the  Name attribute.
    _name:"Will Smith"