oracle endeca server to the endeca query language 2 • corpus: the full body of...

Download Oracle Endeca Server to the Endeca Query Language 2 • Corpus: The full body of Endeca Server records. Endeca Server data is corpus– based rather than table– based

Post on 29-Apr-2018

214 views

Category:

Documents

1 download

Embed Size (px)

TRANSCRIPT

  • Oracle Endeca Server

    Query Language Reference

    Version 7.4.0 September 2012

  • Copyright and disclaimerCopyright 2003, 2012, Oracle and/or its affiliates. All rights reserved.

    Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks oftheir respective owners. UNIX is a registered trademark of The Open Group.

    This software and related documentation are provided under a license agreement containing restrictions onuse and disclosure and are protected by intellectual property laws. Except as expressly permitted in yourlicense agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license,transmit, distribute, exhibit, perform, publish or display any part, in any form, or by any means. Reverseengineering, disassembly, or decompilation of this software, unless required by law for interoperability, isprohibited.

    The information contained herein is subject to change without notice and is not warranted to be error-free. Ifyou find any errors, please report them to us in writing.

    If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it onbehalf of the U.S. Government, the following notice is applicable:

    U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software,any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are"commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of theprograms, including any operating system, integrated software, any programs installed on the hardware,and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. Noother rights are granted to the U.S. Government.

    This software or hardware is developed for general use in a variety of information management applications. Itis not developed or intended for use in any inherently dangerous applications, including applications that maycreate a risk of personal injury. If you use this software or hardware in dangerous applications, then you shallbe responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safeuse. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this softwareor hardware in dangerous applications.

    This software or hardware and documentation may provide access to or information on content, products andservices from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaimall warranties of any kind with respect to third-party content, products, and services. Oracle Corporation andits affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use ofthird-party content, products, or services.

    Rosette Linguistics Platform Copyright 2000-2011 Basis Technology Corp. All rights reserved.

    Teragram Language Identification Software Copyright 1997-2005 Teragram Corporation. All rights reserved.

    Oracle Endeca Server : Query Language Reference Version 7.4.0 September 2012

  • Table of Contents

    Copyright and disclaimer ..........................................................ii

    Preface..........................................................................vAbout this guide.................................................................vWho should use this guide .........................................................vConventions used in this guide......................................................vContacting Oracle Customer Support .................................................v

    Chapter 1: Introduction to the Endeca Query Language ................................1EQL overview ..................................................................1Important concepts and terms ......................................................1EQL and SQL: a comparison .......................................................2How queries are processed ........................................................3

    Chapter 2: EQL Syntax and Semantics ...............................................4Query overview .................................................................4Statements and clauses...........................................................5

    DEFINE and RETURN clauses .................................................6SELECT clauses ............................................................6FROM clauses .............................................................7JOIN clauses...............................................................8WHERE clauses ...........................................................11GROUP/GROUP BY clauses ..................................................12HAVING clauses ...........................................................14ORDER BY clauses.........................................................14PAGE clauses.............................................................15

    Grouping and aggregation ........................................................17Multi-level aggregation.......................................................17Using the COUNT and COUNTDISTINCT functions .................................17Per-aggregation filters .......................................................18Handling of records with multiple values for an attribute...............................18

    Expressions ..................................................................19Supported data types........................................................19Operator precedence rules in EQL ..............................................19Literals ..................................................................20

    Handling of characters in EQL .............................................20Handling of upper- and lower-case in EQL ....................................21Handling NULL attribute values ............................................21Type promotion in EQL ..................................................22Handling of NaN, inf, and -inf results ........................................23

    Functions and operators .....................................................24Numeric functions ......................................................24

    Oracle Endeca Server : Query Language Reference Version 7.4.0 September 2012

  • Aggregation functions ...................................................26Hierarchy functions .....................................................27Geocode functions......................................................29Working with date and time values in EQL ....................................29

    Manipulating current date and time.....................................31Constructing date and time values .....................................31Timezone manipulation .............................................32Using EXTRACT to extract a portion of a dateTime value ....................33Using TRUNC to round down dateTime values ............................35Using arithmetic operations on date and time values ........................35

    Arithmetic operators ....................................................36Boolean operators......................................................36

    Using EQL results to compose follow-on queries....................................36Using AS expressions to calculate derived attributes.................................37COALESCE ..............................................................38CASE ...................................................................38Using inter-statement references ...............................................39IN......................................................................40LOOKUP ................................................................41

    Chapter 3: EQL Use Cases ........................................................42Re-normalization ...............................................................42Grouping by range buckets .......................................................43Manipulating records in a dynamically computed range value ..............................44Grouping data into quartiles .......................................................44Combining multiple sparse fields into one .............................................46Counting multi-assign terms.......................................................46Joining data from different types of records............................................47Joining on hierarchy ............................................................47Linear regressions in EQL ........................................................48Using an IN filter for pie chart segmentation ...........................................49Running sum..................................................................49Query by age .................................................................49Calculating percent change between most recent month and previous month...................50

    Chapter 4: EQL Best Practices.....................................................51Controlling input size ............................................................51Filtering as early as possible ......................................................52Controlling join size .............................................................53Additional tips .................................................................53

    Oracle Endeca Server : Query Language Reference Version 7.4.0 September 2012

  • PrefaceOracle Endeca Server is the core search-analytical database. It organizes complex and varied data fromdisparate source sys

View more >