![]() ![]() Note the bind variable :doc_text which contains the document CLOB to be classified. Assuming that a table querytable has a CTXRULE index associated with it, you can issue the following query: SELECT classification FROM querytable WHERE MATCHES(query_string,:doc_text) > 0 NOAM within author and english within languageĪ MATCHES query finds all rows in a query table that match a given document. We need to use query template with CONTEXT grammar to access field cannot be accessed using CTXCAT grammar (default for CATSEARCH). Note that: even though CTXCAT index can be created with field sections, it Parameters('index set book_index_set section group book_section_group') Insert into BOOKS values(1, 'LUC SANTEXMLĮxec ctx_ddl.create_index_set('BOOK_INDEX_SET') Įxec ctx_ddl.add_index('BOOKSET','PUBDATE') Įxec ctx_ddl.create_section_group('BOOK_SECTION_GROUP',Įxec ctx_ddl.add_field_section('BOOK_SECTION_GROUP','AUTHOR','AUTHOR') Įxec ctx_ddl.add_field_section('BOOK_SECTION_GROUP','SUBJECT','SUBJECT') Įxec ctx_ddl.add_field_section('BOOK_SECTION_GROUP','LANGUAGE','LANGUAGE') Įxec ctx_ddl.add_field_section('BOOK_SECTION_GROUP','PUBLISHER','PUBLISHER') Ĭreate index books_index on books(info) indextype is ctxsys.ctxcat Insert into BOOKS values(2, 'NICANOR PARRAPOEMS Insert into BOOKS values(1, 'NOAM CHOMSKYCIVIL Create and populate tableĬreate table BOOKS (ID number, INFO varchar2(200), PUBDATE DATE) Learn how to refer to a saved question in a SQL query.The following example shows a field section search against a CTXCAT index using CONTEXT grammar by means of a query template in a CATSEARCH query. Next: Referencing saved questions in queries Field Filters: create smart filter widgets for SQL questions.Create filter widgets for charts using SQL variables.So if you are trying to use one of the other Time options on the dashboard, you’ll need to change the variable to a Field Filter variable and map it to a date column. If you add a Date variable to the question, then it’s only possible to use the dashboard filter option Single Date. In this example, you’d create a new dashboard (or go to an existing dashboard), click the Pencil icon to enter Dashboard edit mode, add the SQL question that contains your State Field Filter variable, add a new dashboard filter (or edit an existing Location filter), then click the dropdown on the SQL question card to see the State Field Filter. To make a clause optional in your native query, type [[brackets around a and you map it to a State field, you can map a Location dashboard filter to your SQL question. For example, you can create an optional WHERE clause that contains a SQL variable, so that if no value is supplied to the variable (either in the filter or via the URL), the query will still run as if there were no WHERE clause. You can make a clause optional in a query. When you have multiple filter widgets, you can click on a filter widget and drag it around to rearrange the order. You can include multiple variables in the query, and Metabase will add multiple filter widgets to the question. That last variable type, Field Filter, is special it lets you create “smart” filter widgets, like a search box, or a dropdown menu of values, or a dynamic date picker that allows you to specify a date range. Field Filter: different filter widgets, depending on the mapped field.If you want a more expressive date picker, like specifying a range, you’ll want to use a Field Filter. You can set a type for a variable, which changes the kind of filter widget that Metabase presents. When you define a variable, the Variables side panel will appear. ![]()
0 Comments
Leave a Reply. |