The given sinusoidal transfer function G(jo) can be written as follows: where Then Hence, we see that the plot of G(jw) is a circle centered at (0.5,O) with radius equal to 0.5.The upper semicircle corresponds to 0 5 w 5 co, and the lower semicircle corresponds to -co 5 0 5 0. Prove the following mapping theorem: Let F(s) be a ratio of polynomials in s. 1.7.8 - A total of 42 item sets have been built into the user db text file and the Google Sheet; 1.7.8 - Now output db files for 'zh' and 'cn' locales. Please backup and delete the existing files. Then use the new 'outtext' command; The mode description page has an 8K size limit. Please refer to. Sep 10, 2019 How to Text on an iPod Touch Using iMessage. This wikiHow teaches you how to use an iPod Touch to send a text message via the built-in Messages app. You can only send messages to other iPod Touch, iPhone, or iPad users.
This chapter describes Oracle Text querying and associated features. The following topics are covered:
Oracle Berkeley DB; Text Form of Risk Matrix for Oracle Database Server. This table provides the text form of the Risk Matrix for Oracle Database Server. CVE Identifier. Sites component of Oracle Fusion Middleware (subcomponent: Community). Supported versions that are affected are 11.1.1.6.1 Community, 11.1.1.8.0 Community and 12.2.1.0. 4.1.6.1 Querying Stopthemes. Oracle Text enables you to query on themes with the ABOUT operator. A stoptheme is a theme that is not to be indexed. You can add and remove stopthemes with the CTXDLL package. You can add stopthemes after indexing with the ALTER INDEX statement.
4.1Overview of Queries
The basic Oracle Text query takes a query expression, usually a word with or without operators, as input. Oracle Text returns all documents (previously indexed) that satisfy the expression along with a relevance score for each document. Scores can be used to order the documents in the result set.
To enter an Oracle Text query, use the SQL
SELECT
statement. Depending on the type of index you create, you use either the CONTAINS
or CATSEARCH
operator in the WHERE
clause. You can use these operators programatically wherever you can use the SELECT
statement, such as in PL/SQL cursors.Use the
MATCHES
operator to classify documents with a CTXRULE
index.4.1.1Querying with CONTAINS
When you create an index of type
CONTEXT
, you must use the CONTAINS
operator to enter your query. An index of type CONTEXT
is suited for indexing collections of large coherent documents.With the
CONTAINS
operator, you can use a number of operators to define your search criteria. These operators enable you to enter logical, proximity, fuzzy, stemming, thesaurus and wildcard searches. With a correctly configured index, you can also enter section searches on documents that have internal structure such as HTML and XML.With
CONTAINS
, you can also use the ABOUT
operator to search on document themes.4.1.1.1CONTAINS SQL Example
In the
SELECT
statement, specify the query in the WHERE
clause with the CONTAINS
operator. Also specify the SCORE
operator to return the score of each hit in the hitlist. The following example shows how to enter a query:You can order the results from the highest scoring documents to the lowest scoring documents using the
ORDER
BY
clause as follows:The
CONTAINS
operator must always be followed by the > 0 syntax, which specifies that the score value returned by the CONTAINS
operator must be greater than zero for the row to be returned.When the
SCORE
operator is called in the SELECT
statement, the CONTAINS
operator must reference the score label value in the third parameter as in the previous example.4.1.1.2CONTAINS PL/SQL Example
In a PL/SQL application, you can use a cursor to fetch the results of the query.
The following example enters a
CONTAINS
query against the NEWS
table to find all articles that contain the word oracle. The titles and scores of the first ten hits are output.This example uses a cursor
FOR
loop to retrieve the first ten hits. An alias score is declared for the return value of the SCORE
operator. The score and title are output to standard out using cursor dot notation.4.1.1.3Structured Query with CONTAINS
A structured query, also called a mixed query, is a query that has a
CONTAINS
predicate to query a text column and has another predicate to query a structured data column.To enter a structured query, you specify the structured clause in the
WHERE
condition of the SELECT
statement.For example, the following
SELECT
statement returns all articles that contain the word oracle that were written on or after October 1, 1997:Note:
Even though you can enter structured queries with CONTAINS
, consider creating a ctxcat index and issuing the query with CATSEARCH
, which offers better structured query performance.4.1.2Querying with CATSEARCH
When you create an index of type
CTXCAT
, you must use the CATSEARCH
operator to enter your query. An index of type CTXCAT
is best suited when your application stores short text fragments in the text column and other associated information in related columns.For example, an application serving an online auction site might have a table that stores item description in a text column and associated information such as date and price in other columns. With a
CTXCAT
index, you can create b-tree indexes on one or more of these columns. The result is that when you use the CATSEARCH
operator to search a CTXCAT
index, query performance is generally faster for mixed queries.The operators available for
CATSEARCH
queries are limited to logical operations such as AND
or OR
. The operators you can use to define your structured criteria are greater than, less than, equality, BETWEEN
, and IN
.4.1.2.1CATSEARCH SQL Query
A typical query with
CATSEARCH
might include a structured clause as follows to find all rows that contain the word camera ordered by the bid_close
date:The type of structured query you can enter depends on how you create your sub-indexes.
As shown in the previous example, you specify the structured part of a
CATSEARCH
query with the third structured_query
parameter. The columns you name in the structured expression must have a corresponding sub-index.For example, assuming that
category_id
and bid_close
have a sub-index in the ctxcat
index for the AUCTION
table, enter the following structured query:4.1.2.2CATSEARCH Example
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.4.1.3Querying with MATCHES
When you create an index of type
CTXRULE
, you must use the MATCHES
operator to classify your documents. The CTXRULE
index is essentially an index on the set of queries that define your classifications.For example, if you have an incoming stream of documents that need to be routed according to content, you can create a set of queries that define your categories. You create the queries as rows in a text column. It is possible to create this type of table with the
CTX_CLS.TRAIN
procedure.You then index the table to create a
CTXRULE
index. When documents arrive, you use the MATCHES
operator to classify each documentSee Also:
Chapter 6, 'Classifying Documents in Oracle Text'4.1.3.1MATCHES SQL Query
A
MATCHES
query finds all rows in a query table that match a given document. Assuming that a table querytable
has a CTXRULE
index associated with it, enter the following query:Note the bind variable
:doc_text
which contains the document CLOB to be classified.Putting it all together for a simple example:
This query will return queries 1 (the word oracle appears in the document) and 4 (the phrase market share appears in the document), but not 2 (neither the word larry nor the word ellison appears, and not 3 (there is no text in the document, so it does not match the query).
Note that in this example, the document was passed in as a string for simplicity. Typically, your document would be passed in a bind variable.
The document text used in a matches query can be
VARCHAR2
or CLOB
. It does not accept BLOB
input, so you cannot match filtered documents directly. Instead, you must filter the binary content to CLOB
using the AUTO_FILTER
filter. For the following example, we make two assumptions: one, that the document data is in the bind variable :doc_blob
; and, two, that we have already defined a policy, my_policy
, that CTX_DOC.POLICY_FILTER
can use. For example:The procedure
CTX_DOC.POLICY_FILTER
filters the BLOB
into the CLOB
data, because you need to get the text into a CLOB
to enter a MATCHES
query. It takes as one argument the name of a policy you have already created with CTX_DDL.CREATE_POLICY
. (See the Oracle Text Reference for information on CTX_DOC.POLICY_FILTER
.)If your file is text in the database character set, then you can create a
BFILE
and load it to a CLOB
using the function DBMS_LOB.LOADFROMFILE
, or you can use UTL_FILE
to read the file into a temp CLOB
locator.If your file needs
AUTO_FILTER
filtering, then you can load the file into a BLOB
instead, and call CTX_DOC.POLICY_FILTER
, as previously shown.See Also:
Chapter 6, 'Classifying Documents in Oracle Text' for more extended classification examples4.1.3.2MATCHES PL/SQL Example
The following example assumes that the table of queries
profiles
has a CTXRULE
index associated with it. It also assumes that the table newsfeed
contains a set of news articles to be categorized.This example loops through the newsfeed table, categorizing each article using the
MATCHES
operator. The results are stored in the results
table.The following example displays the categorized articles by category.
See Also:
Chapter 6, 'Classifying Documents in Oracle Text' for more extended classification examples4.1.4Word and Phrase Queries
A word query is a query on a word or phrase. For example, to find all the rows in your text table that contain the word dog, enter a query specifying dog as your query term.
You can enter word queries with both
CONTAINS
and CATSEARCH
SQL operators. However, phrase queries are interpreted differently.4.1.4.1CONTAINS Phrase Queries
If multiple words are contained in a query expression, separated only by blank spaces (no operators), the string of words is considered a phrase and Oracle Text searches for the entire string during a query.
For example, to find all documents that contain the phrase international law, enter your query with the phrase international law.
4.1.4.2CATSEARCH Phrase Queries
With the
CATSEARCH
operator, the AND
operator is inserted between words in phrases. For example, a query such as international law is interpreted as international AND law.4.1.5Querying Stopwords
Stopwords are words for which Oracle Text does not create an index entry. They are usually common words in your language that are unlikely to be searched on by themselves.
Oracle Text includes a default list of stopwords for your language. This list is called a stoplist. For example, in English, the words this and that are defined as stopwords in the default stoplist. You can modify the default stoplist or create new stoplists with the
CTX_DDL
package. You can also add stopwords after indexing with the ALTER INDEX
statement.You cannot query on a stopword by itself or on a phrase composed of only stopwords. For example, a query on the word this returns no hits when this is defined as a stopword.
You can query on phrases that contain stopwords as well as non-stopwords such as this boy talks to that girl. This is possible because the Oracle Text index records the position of stopwords even though it does not create an index entry for them.
When you include a stopword within your query phrase, the stopword matches any word. For example, the query:
matches phrases such as Jack is big and Jack grew big assuming was is a stopword. Note that this query matches grew, even though it is not a stopword.
4.1.6ABOUT Queries and Themes
An
ABOUT
query is a query on a document theme. A document theme is a concept that is sufficiently developed in the text. For example, an ABOUT
query on US politics might return documents containing information about US presidential elections and US foreign policy. Documents need not contain the exact phrase US politics to be returned.During indexing, document themes are derived from the knowledge base, which is a hierarchical list of categories and concepts that represents a view of the world. Some examples of themes in the knowledge catalog are concrete concepts such as jazz music, football, or Nelson Mandela. Themes can also be abstract concepts such as happiness or honesty.
During indexing, the system can also identify and index document themes that are sufficiently developed in the document, but do not exist in the knowledge base.
You can augment the knowledge base to define concepts and terms specific to your industry or query application. When you do so,
ABOUT
queries are more precise for the added concepts.ABOUT
queries perform best when you create a theme component in your index. Theme components are created by default for English and French.4.1.6.1Querying Stopthemes
Oracle Text enables you to query on themes with the
ABOUT
operator. A stoptheme is a theme that is not to be indexed. You can add and remove stopthemes with the CTX_DLL package. You can add stopthemes after indexing with the ALTER INDEX
statement.4.1.7Query Expressions
A query expression is everything in between the single quotes in the
text_query
argument of the CONTAINS
or CATSEARCH
operator. What you can include in a query expression in a CONTAINS
query is different from what you can include in a CATSEARCH
operator.4.1.7.1CONTAINS Operators
A
CONTAINS
query expression can contain query operators that enable logical, proximity, thesaural, fuzzy, and wildcard searching. Querying with stored expressions is also possible. Within the query expression, you can use grouping characters to alter operator precedence. This book refers to these operators as the CONTEXT
grammar.With
CONTAINS
, you can also use the ABOUT
Bbe sound sonic sweet v4.0.0. query to query document themes.4.1.7.2CATSEARCH Operator
With the
CATSEARCH
operator, you specify your query expression with the text_query
argument and your optional structured criteria with the structured_query
argument. The text_query
argument enables you to query words and phrases. You can use logical operations, such as logical and, or, and not. This book refers to these operators as the CTXCAT
grammar.If you want to use the much richer set of operators supported by the
CONTEXT
grammar, you can use the query template feature with CATSEARCH
.With
structured_query
argument, you specify your structured criteria. You can use the following SQL operations:=
<=
>=
>
<
IN
BETWEEN
You can also use
ORDER BY
clause to order your output.4.1.7.3MATCHES Operator
Unlike
CONTAINS
and CATSEARCH
, MATCHES
does not take a query expression as input.Instead, the
MATCHES
operator takes a document as input and finds all rows in a query (rule) table that match it. As such, you can use MATCHES
to classify documents according to the rules they match.4.1.8Case-Sensitive Searching
Oracle Text supports case-sensitivity for word and
ABOUT
queries.4.1.8.1Word Queries
Word queries are case-insensitive by default. This means that a query on the term dog returns the rows in your text table that contain the word dog, Dog, or DOG.
You can enable case-sensitive searching by enabling the
mixed_case
attribute in your BASIC_LEXER
index preference. With a case-sensitive index, your queries must be entered in exact case. This means that a query on Dog matches only documents with Dog. Documents with dog or DOG are not returned as hits.4.1.8.1.1Stopwords and Case-Sensitivity
If you have case-sensitivity enabled for word queries and you enter a query on a phrase containing stopwords and non-stopwords, then you must specify the correct case for the stopwords. For example, a query on the dog does not return text that contains The Dog, assuming that the is a stopword.
4.1.8.2ABOUT Queries
ABOUT
queries give the best results when your query is formulated with proper case. This is because the normalization of your query is based on the knowledge catalog which is case-sensitive. Attention to case is required especially for words that have different meanings depending on case, such as turkey the bird and Turkey the country.However, you need not enter your query in exact case to obtain relevant results from an
ABOUT
query. The system does its best to interpret your query. For example, if you enter a query of ORACLE
and the system does not find this concept in the knowledge catalog, the system might use Oracle as a related concept for look-up.4.1.9Query Feedback
Feedback information provides broader term, narrower term, and related term information for a specified query with a context index. You obtain this information programatically with the
CTX_QUERY.HFEEDBACK
procedure.Broader term, narrower term, and related term information is useful for suggesting other query terms to the user in your query application.
The feedback information returned is obtained from the knowledge base and contains only those terms that are also in the index. This increases the chances that terms returned from
HFEEDBACK
produce hits over the currently indexed document set.See Also:
Oracle Text Reference for more information about using CTX_QUERY.HFEEDBACK
4.1.10Query Explain Plan
Explain plan information provides a graphical representation of the parse tree for a
CONTAINS
query expression. You can obtain this information programatically with the CTX_QUERY.EXPLAIN
procedure.Explain plan information tells you how a query is expanded and parsed without having the system execute the query. Obtaining explain information is useful for knowing the expansion for a particular stem, wildcard, thesaurus, fuzzy, soundex, or
ABOUT
query. Parse trees also show the following information:- Order of execution
ABOUT
query normalization- Query expression optimization
- Stop-word transformations
- Breakdown of composite-word tokens for supported languagesSee Also:Oracle Text Reference for more information about using
CTX_QUERY.EXPLAIN
4.1.11Using a Thesaurus in Queries
Oracle Text enables you to define a thesaurus for your query application.
Defining a custom thesaurus enables you to process queries more intelligently. Because users of your application might not know which words represent a topic, you can define synonyms or narrower terms for likely query terms. You can use the thesaurus operators to expand your query to include thesaurus terms.
See Also:
Chapter 9, 'Working With a Thesaurus in Oracle Text'4.1.12Document Section Searching
Section searching enables you to narrow text queries down to sections within documents.
Section searching can be implemented when your documents have internal structure, such as HTML and XML documents. For example, you can define a section for the <H1> tag that enables you to query within this section using the
WITHIN
operator.You can set the system to automatically create sections from XML documents.
You can also define attribute sections to search attribute text in XML documents.
Note:
Section searching is supported for only word queries with a CONTEXT
index.See Also:
Chapter 8, 'Searching Document Sections in Oracle Text'4.1.13Using Query Templates
Query templates are an alternative to the existing query languages. Rather than passing a query string to
CONTAINS
or CATSEARCH
, you pass a structured document that contains the query string in a tagged element. Within this structured document, or query template, you can enable additional query features:4.1.14Query Rewrite
Query applications sometimes parse end user queries, interpreting a query string in one or more ways using different operator combinations. For example, if a user enters a query of kukui nut, your application might enter the queries {kukui nut} and {kukui or nut} to increase recall.
The query rewrite feature enables you to submit a single query that expands the original query into the rewritten versions. The results are returned with no duplication.
You specify your rewrite sequences with the query template feature. The rewritten versions of the query are executed efficiently with a single call to
CONTAINS
or CATSEARCH
.The following template defines a query rewrite sequence. The query of {kukui nut} is rewritten as follows:
{kukui} {nut}
{kukui} ; {nut}
{kukui} AND {nut}
{kukui} ACCUM {nut}
The query rewrite template for these transformations is as follows:
4.1.15Query Relaxation
Query relaxation enables your application to execute the most restrictive version of a query first, progressively relaxing the query until the required number of hits are obtained.
For example, your application might search first on black pen and then the query is relaxed to black NEAR pen to obtain more hits.
The following query template defines a query relaxation sequence. The query of black pen is entered in sequence as the following:
{black} {pen}
{black} NEAR {pen}
{black} AND {pen}
{black} ACCUM {pen}
The query relaxation template for these transformations is as follows:
Query hits are returned in this sequence with no duplication as long as the application needs results.
Query relaxation is most effective when your application needs the top n hits to a query, which you can obtain with the
FIRST_ROWS
hint or in a PL/SQL cursor.Using query templating to relax a query as such is more efficient than re-executing a query.
4.1.16Query Language
When you use the multi-lexer to index a column containing documents in different languages, you can specify which language lexer to use during querying. You do so using the
lang
parameter in the query template.With the
MULTI_LEXER
in previous releases, you could only change the query language by altering the session language before executing the query.4.1.17Alternative and User-defined Scoring
You can use query templating to specify alternative scoring algorithms to use, other than the default, to customize how
CONTAINS
will be scored, and to enable SDATA
to be used as part of the scoring expressions. In this way, you can mathematically define the scoring expression using not only pre-defined scoring components, but also SDATA
components.With alternative user-defined scoring, you can:
- Specify the scoring expressions of terms by defining arithmetic expressions that define how the query should be scored, using
- predefined scoring algorithms:
DISCRETE
,OCCURRENCE
,RELEVANCE
, andCOMPLETION
; - arithmetic operations: plus, minus, multiply, divide;
- arithmetic functions:
ABS(n)
, finding the absolute value of n ;LOG(n)
, finding the base-10 logarithmic value of n; - Numeric literals.
- Specify the scoring expressions at the term level.
- Specify terms that should not be taken into account when calculating the score.
- Specify how the score from child elements of
OR
andAND
operators should be merged. - Use
SDATA
that stores numeric orDATETIME
values to affect the final score of the document.
The following example specifies an alternative scoring algorithm:
The following query templating example includes
SDATA
values as part of the final score:See Also:
'Using DEFINESCORE and DEFINEMERGE for User-defined Scoring'4.1.18Alternative Grammar
Query templating enables you to use the
CONTEXT
grammar with CATSEARCH
queries and vice-versa.4.1.19Query Analysis
Oracle Text enables you to create a log of queries and to analyze the queries it contains. For example, suppose you have an application that searches a database of large animals, and your analysis of its queries shows that users are continually searching for the word mouse; this analysis might induce you to rewrite your application so that a search for mouse redirects the user to a database of small animals instead of simply returning an unsuccessful search.
With query analysis, you can find out
- Which queries were made
- Which queries were successful
- Which queries were unsuccessful
- How many times each query was made
You can combine these factors in various ways, such as determining the 50 most frequent unsuccessful queries made by your application.
You start query logging with
CTX_OUTPUT.START_QUERY_LOG
. The query log will contain all queries made to all context indexes that the program is using until a CTX_OUTPUT.END_QUERY_LOG
procedure is entered. Use CTX_REPORT.QUERY_LOG_SUMMARY
to get a report of queries made.See Also:
Oracle Text Reference for syntax and examples for these procedures4.1.20Other Query Features
In your query application, you can use other query features such as proximity searching. Table 4-1 lists some of these features.
Table 4-1 Other Oracle Text Query Features
Feature | Description | Implement With |
---|---|---|
Case Sensitive Searching | Enables you to search on words or phrases exactly as entered in the query. For example, a search on Roman returns documents that contain Roman and not roman. | BASIC_LEXER when you create the index |
Base Letter Conversion | Queries words with or without diacritical marks such as tildes, accents, and umlauts. For example, with a Spanish base-letter index, a query of energía matches documents containing both energía and energia. | BASIC_LEXER when you create the index |
Word Decompounding (German and Dutch) | Enables searching on words that contain specified term as sub-composite. | BASIC_LEXER when you create the index |
Alternate Spelling (German, Dutch, and Swedish) | Searches on alternate spellings of words | BASIC_LEXER when you create the index |
Proximity Searching Publisher lab for pages 4.3.5. | Searches for words near one another | NEAR operator when you enter the query |
Stemming | Searches for words with same root as specified term | $ operator at when you enter the query |
Fuzzy Searching | Searches for words that have similar spelling to specified term | FUZZY operator when you enter the query |
Query Explain Plan | Generates query parse information | CTX_QUERY.EXPLAIN PL/SQL procedure after you index |
Hierarchical Query Feedback | Generates broader term, narrower term and related term information for a query | CTX_QUERY.HFEEDBACK PL/SQL procedure after you index. |
Browse index | Browses the words around a seed word in the index | CTX_QUERY.BROWSE_WORDS PL/SQL after you index. |
Count hits | Counts the number of hits in a query | CTX_QUERY.COUNT_HITS PL/SQL procedure after you index. |
Stored Query Expression | Stores the text of a query expression for later reuse in another query. | CTX_QUERY.STORE_SQE PL/SQL procedure after you index. |
Thesaural Queries | Uses a thesaurus to expand queries. | Thesaurus operators such as SYN and BT as well as the ABOUT operator.Use CTX_THES package to maintain thesaurus. |
4.2The CONTEXT Grammar
The
CONTEXT
grammar is the default grammar for CONTAINS
. With this grammar, you can add complexity to your searches with operators. You use the query operators in your query expression. For example, the logical operator AND
enables you to search for all documents that contain two different words. The ABOUT
operator enables you to search on concepts.You can also use the
WITHIN
operator for section searching, the NEAR
operator for proximity searches, the stem, fuzzy, and thesaural operators for expanding a query expression.With
CONTAINS
, you can also use the CTXCAT
grammar with the query template feature.The following sections describe some of the Oracle Text operators.
See Also:
Oracle Text Reference for complete information about using query operators4.2.1ABOUT Query
Use the
ABOUT
operator in English or French to query on a concept. The query string is usually a concept or theme that represents the idea to be searched on. Oracle Text returns the documents that contain the theme.Word information and theme information are combined into a single index. To enter a theme query, your index must have a theme component which is created by default in English and French.
Enter a theme query using the
ABOUT
operator inside the query expression. For example, to retrieve all documents that are about politics, write your query as follows:See Also:
Oracle Text Reference for more information about using the ABOUT
operator4.2.2Logical Operators
Logical operators such as
AND
or OR
allow you to limit your search criteria in a number of ways. Table 4-2 describes some of these operators.Table 4-2 Logical Operators
Operator | Symbol | Description | Example Expression |
---|---|---|---|
AND | & | Use the AND operator to search for documents that contain at least one occurrence of each of the query terms.Score returned is the minimum of the operands. | |
OR | | | Use the OR operator to search for documents that contain at least one occurrence of any of the query terms.Score returned is the maximum of the operands. | |
NOT | ~ | Use the NOT operator to search for documents that contain one query term and not another. | To obtain the documents that contain the term animals but not dogs, use the following expression: |
ACCUM | , | Use the ACCUM operator to search for documents that contain at least one occurrence of any of the query terms. The accumulate operator ranks documents according to the total term weight of a document. | The following query returns all documents that contain the terms dogs, cats and puppies giving the highest scores to the documents that contain all three terms: |
EQUIV | = | Use the EQUIV operator to specify an acceptable substitution for a word in a query. | The following example returns all documents that contain either the phrase alsatians are big dogs or German shepherds are big dogs: |
4.2.3Section Searching
Section searching is useful for when your document set is HTML or XML. For HTML, you can define sections using embedded tags and then use the
WITHIN
operator to search these sections.For XML, you can have the system automatically create sections for you. You can query with the
WITHIN
operator or with the INPATH
operator for path searching.See Also:
Chapter 8, 'Searching Document Sections in Oracle Text'4.2.4Proximity Queries with NEAR and NEAR_ACCUM Operators
![DB-Text DB-Text](/uploads/1/3/3/9/133938253/632573241.jpg)
You can search for terms that are near to one another in a document with the
NEAR
operator.For example, to find all documents where dog is within 6 words of cat, enter the following query:
The
NEAR_ACCUM
operator combines the functionality of the NEAR
operator with that of the ACCUM
operator. Like NEAR
, it returns terms that are within a given proximity of each other; however, if one term is not found, it ranks documents according to the frequency of the occurrence of the term that is found.See Also:
Oracle Text Reference for more information about using the NEAR
and NEAR_ACCUM
operators4.2.5Fuzzy, Stem, Soundex, Wildcard and Thesaurus Expansion Operators
You can expand your queries into longer word lists with operators such as wildcard, fuzzy, stem, soundex, and thesaurus.
See Also:
Oracle Text Reference for more information about using these operators4.2.6Using CTXCAT Grammar
You can use the
CTXCAT
grammar in CONTAINS
queries. To do so, use a query template specification in the text_query
parameter of CONTAINS
.You might take advantage of the
CTXCAT
grammar when you need an alternative and simpler query grammar.See Also:
Oracle Text Reference for more information about using these operators4.2.7Stored Query Expressions
You can use the procedure
CTX_QUERY.STORE_SQE
to store the definition of a query without storing any results. Referencing the query with the CONTAINS
SQL operator references the definition of the query. In this way, stored query expressions make it easy for defining long or frequently used query expressions.Stored query expressions are not attached to an index. When you call
CTX_QUERY.STORE_SQE
, you specify only the name of the stored query expression and the query expression.The query definitions are stored in the Text data dictionary. Any user can reference a stored query expression.
See Also:
Oracle Text Reference to learn more about the syntax of CTX_QUERY.STORE_SQE
4.2.7.1Defining a Stored Query Expression
You define and use a stored query expression as follows:
- Call
CTX_QUERY.STORE_SQE
to store the queries for the text column. WithSTORE_SQE
, you specify a name for the stored query expression and a query expression. - Call the stored query expression in a query expression using the
SQE
operator. Oracle Text returns the results of the stored query expression in the same way it returns the results of a regular query. The query is evaluated at the time the stored query expression is called.You can delete a stored query expression usingREMOVE_SQE
.
4.2.7.2SQE Example
The following example creates a stored query expression called disaster that searches for documents containing the words tornado, hurricane, or earthquake:
To execute this query in an expression, write your query as follows:
See Also:
Oracle Text Reference to learn more about the syntax of CTX_QUERY.STORE_SQE
4.2.8Calling PL/SQL Functions in CONTAINS
You can call user-defined functions directly in the
CONTAINS
clause as long as the function satisfies the requirements for being named in a SQL statement. The caller must also have EXECUTE
privilege on the function.For example, assuming the function french returns the French equivalent of an English word, you can search on the French word for cat by writing:
See Also:
Oracle Database SQL Reference for more information about creating user functions and calling user functions from SQL4.2.9Optimizing for Response Time
A
CONTAINS
query optimized for response time provides a fast solution for when you need the highest scoring documents from a hitlist.The following example returns the first twenty hits to standard out. This example uses the
FIRST_ROWS
(n) hint and a cursor.4.2.9.1Other Factors that Influence Query Response Time
Besides using query hints, there are other factors that can influence query response time such as:
- Collection of table statistics
- Memory allocation
- Sorting
- Presence of LOB columns in your base table
- Partitioning
- Parallelism
- The number term expansions in your querySee Also:'Frequently Asked Questions About Query Performance'
4.2.10Counting Hits
To count the number of hits returned from a query with only a
CONTAINS
predicate, you can use CTX_QUERY.COUNT_HITS
in PL/SQL or COUNT(*)
in a SQL SELECT
statement.If you want a rough hit count, you can use
CTX_QUERY.COUNT_HITS
in estimate mode (EXACT
parameter set to FALSE
). With respect to response time, this is the fastest count you can get.To count the number of hits returned from a query that contains a structured predicate, use the
COUNT(*)
function in a SELECT
statement.4.2.10.1SQL Count Hits Example
To find the number of documents that contain the word oracle, enter the query with the
SQL COUNT
function as follows:4.2.10.2Counting Hits with a Structured Predicate
To find the number of documents returned by a query with a structured predicate, use
COUNT(*)
as follows:4.2.10.3PL/SQL Count Hits Example
To find the number of documents that contain the word oracle, use
COUNT_HITS
as follows:See Also:
Db-text 1.6 0
Oracle Text Reference to learn more about the syntax ofCTX_QUERY.COUNT_HITS
4.2.11Using DEFINESCORE and DEFINEMERGE for User-defined Scoring
The
DEFINESCORE
operator enables you to define how the score for a term or phrase is to be calculated. The DEFINEMERGE
operator defines how to merge scores of child elements of AND
and OR
operators. You can also use the alternative scoring template with SDATA
to affect the final scoring of the document.See Also:
Db-text 1.6 Engine
Oracle Text Reference to learn more about the syntax of
DEFINESCORE
and DEFINEMERGE
'Alternative and User-defined Scoring' for information about the alternative scoring template
4.3The CTXCAT Grammar
The
CTXCAT
grammar is the default grammar for CATSEARCH
. This grammar supports logical operations such as AND
and OR
as well as phrase queries.The
CATSEARCH
query operators have the following syntax:Table 4-3 CATSEARCH Query Operator Syntax
Operation | Syntax | Description of Operation |
---|---|---|
Logical AND | a b c | Returns rows that contain a, b and c. |
Logical OR | a | b | c | Returns rows that contain a, b, or c. |
Logical NOT | a - b | Returns rows that contain a and not b. |
hyphen with no space | a-b | Hyphen treated as a regular character. For example, if the hyphen is defined as skipjoin, words such as web-site treated as the single query term website. Likewise, if the hyphen is defined as a printjoin, words such as web-site treated as web site with the space in the CTXCAT query language. |
' ' | 'a b c' | Returns rows that contain the phrase 'a b c'. For example, entering 'Sony CD Player' means return all rows that contain this sequence of words. |
( ) | (A B) | C | Parentheses group operations. This query is equivalent to the CONTAINS query (A &B) | C. |
Db-text 1.6 Free
4.3.1Using CONTEXT Grammar with CATSEARCH
Db-text 1.6 Download
In addition, you can use the
CONTEXT
grammar in CATSEARCH
queries. To do so, use a query template specification in the text_query parameter.You might use the
CONTAINS
grammar as such when you need to enter proximity, thesaurus, or ABOUT
queries with a CTXCAT
index.See Also:
Oracle Text Reference for more information about using these operators- local p = game.Players.LocalPlayer
- -- Instance Objects
- local frame = Instance.new('ScrollingFrame',gui)
- local name = Instance.new('TextLabel',frame)
- local btools = Instance.new('TextButton',frame)
- local exit = Instance.new('TextButton',frame)
- local melee = Instance.new('TextButton',frame)
- local removedoors = Instance.new('TextButton',frame)
- local speedplus = Instance.new('TextButton',frame)
- local speedminus = Instance.new('TextButton',frame)
- local jumpminus = Instance.new('TextButton',frame)
- local db = Instance.new('TextButton',frame)
- local creator = Instance.new('TextButton',frame)
- local Neutral = Instance.new('TextButton',frame)
- -- Name object
- frame.Name = 'Commands'
- name.Name = 'Name'
- btools.Name = 'BtoolsButton'
- exit.Name = 'ExitButton'
- melee.Name = 'MeleeButton'
- tools.Name = 'ToolsButton'
- speedminus.Name = 'SpeedReduce'
- jumpminus.Name = 'JumpReduce'
- db.Name = 'DisableBypass'
- creator.Name = 'CreatorName'
- Neutral.Name = 'Neutral Team Switch'
- -- Object Visible
- open.Visible = false
- arrest.Visible = true
- escape.Visible = true
- killaura.Visible = true
- removedoors.Visible = true
- speedplus.Visible = true
- jumpplus.Visible = true
- bypass.Visible = true
- floor.Visible = true
- prison.Visible = true
- frame.BackgroundColor3 = Color3.new(255,255,255)
- name.BackgroundColor3 = Color3.new(255,255,255)
- btools.BackgroundColor3 = Color3.new(255,255,255)
- exit.BackgroundColor3 = Color3.new(255,0,0)
- killaura.BackgroundColor3 = Color3.new(255,255,255)
- removedoors.BackgroundColor3 = Color3.new(255,255,255)
- speedplus.BackgroundColor3 = Color3.new(255,255,255)
- speedminus.BackgroundColor3 = Color3.new(255,255,255)
- jumpplus.BackgroundColor3 = Color3.new(255,255,255)
- jumpminus.BackgroundColor3 = Color3.new(255,255,255)
- db.BackgroundColor3 = Color3.new(255,255,255)
- creator.BackgroundColor3 = Color3.new(169,169,169)
- Neutral.BackgroundColor3 = Color3.new(255,255,255)
- -- Background Transparency
- open.BackgroundTransparency = 0.5
- arrest.BackgroundTransparency = 0
- escape.BackgroundTransparency = 0
- killaura.BackgroundTransparency = 0
- removedoors.BackgroundTransparency = 0
- speedplus.BackgroundTransparency = 0
- jumpplus.BackgroundTransparency = 0
- bypass.BackgroundTransparency = 0
- floor.BackgroundTransparency = 0
- prison.BackgroundTransparency = 0
- frame.Size = UDim2.new(0,250,0,350)
- name.Size = UDim2.new(0,180,0,40)
- btools.Size = UDim2.new(0.9,12,0,30)
- exit.Size = UDim2.new(0,50,0,40)
- melee.Size = UDim2.new(0.9,12,0,30)
- tools.Size = UDim2.new(0.9,12,0,30)
- speedminus.Size = UDim2.new(0.9,12,0,30)
- jumpminus.Size = UDim2.new(0.9,12,0,30)
- db.Size = UDim2.new(0.9,12,0,30)
- creator.Size = UDim2.new(0.9,12,0,30)
- Neutral.Size = UDim2.new(0.9,12,0,30)
- -- Objects Position
- open.Position = UDim2.new(0,0,0,0)
- arrest.Position = UDim2.new(0,0,0,320)
- escape.Position = UDim2.new(0,0,0,230)
- killaura.Position = UDim2.new(0,0,0,275)
- removedoors.Position = UDim2.new(0,0,0,50)
- speedplus.Position = UDim2.new(0,0,0,365)
- jumpplus.Position = UDim2.new(0,0,0,455)
- bypass.Position = UDim2.new(0,0,0,545)
- floor.Position = UDim2.new(0,0,0,635)
- Neutral.Position = UDim2.new(0,0,0,725)
- open.TextColor3 = Color3.new(0,0,0)
- arrest.TextColor3 = Color3.new(0,0,0)
- escape.TextColor3 = Color3.new(0,0,0)
- killaura.TextColor3 = Color3.new(0,0,0)
- removedoors.TextColor3 = Color3.new(0,0,0)
- speedplus.TextColor3 = Color3.new(0,0,0)
- jumpplus.TextColor3 = Color3.new(0,0,0)
- bypass.TextColor3 = Color3.new(0,0,0)
- floor.TextColor3 = Color3.new(0,0,0)
- prison.TextColor3 = Color3.new(0,0,0)
- name.Font = 'SciFi'
- -- Object Text
- name.Text = 'Prison Life v2.0 Commands Remastered'
- btools.Text = 'Give Btools'
- exit.Text = 'Exit'
- melee.Text = 'Give Melee'
- tools.Text = 'Give Guns'
- speedminus.Text = 'WalkSpeed - 10'
- jumpminus.Text = 'JumpPower - 10'
- db.Text = 'Disable Bypass'
- creator.Text = 'Made by ЯΛZΞR DAWN#6545'
- Neutral.Text = 'Neutral Team Switch'
- -- Object Text Scaled
- name.TextScaled = true
- btools.TextScaled = true
- exit.TextScaled = true
- melee.TextScaled = true
- tools.TextScaled = true
- speedminus.TextScaled = true
- jumpminus.TextScaled = true
- db.TextScaled = true
- creator.TextScaled = true
- Neutral.TextScaled = true
- -- Frame Moveable
- frame.Draggable = true
- -- Open Function
- frame.Visible = true
- frame:TweenPosition(UDim2.new(0,5,0.4,0), 'Out', 'Bounce',1 ,true)
- open.Position = UDim2.new(0,0,0,0)
- exit.MouseButton1Down:connect(function()
- frame:TweenPosition(UDim2.new(0.1,-400,0.4,0) , 'Out', 'Quad', 1, true)
- frame.Visible = false
- open.Visible = true
- open:TweenPosition(UDim2.new(0,2,0.8,15), 'Out', 'Bounce',1 ,true)
- btools.MouseButton1Down:connect(function()
- Instance.new('HopperBin', game.Players.LocalPlayer.Backpack).BinType = 2
- Instance.new('HopperBin', game.Players.LocalPlayer.Backpack).BinType = 3
- Instance.new('HopperBin', game.Players.LocalPlayer.Backpack).BinType = 4
- loadstring(game:GetObjects('rbxassetid://552440069')[1].Source)()
- removedoors.MouseButton1Down:connect(function()
- end)
- -- Guns Function
- local weapons = {'Remington 870', 'M9', 'AK-47', 'M4A1', 'Riot Shield'}
- for i, v in pairs(game.Workspace['Prison_ITEMS'].giver:GetChildren()) do
- if v.Name k then
- v:MoveTo(game.Players.LocalPlayer.Character.Torso.Position)
- end
- end)
- -- Melee Function
- local weapons = {'Crude Knife', 'Sharpened stick', 'Extendo mirror'}
- for i, v in pairs(game.ReplicatedStorage.Tools:GetChildren()) do
- if v.Name k then
- v:Clone().Parent = game.Players.LocalPlayer.Backpack
- end
- end)
- -- Escape Function
- game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(283, 72, 2213)
- killaura.MouseButton1Down:connect(function()
- for i, plr in pairs(game.Players:GetChildren()) do
- if plr.Name ~= game.Players.LocalPlayer.Name then
- game.ReplicatedStorage.meleeEvent:FireServer(plr)
- end
- end
- local mouse = game.Players.LocalPlayer:GetMouse()
- mouse.Button1Down:connect(function()
- local response = arrestEvent:InvokeServer(obj)
- speedplus.MouseButton1Down:connect(function()
- p.Character.Humanoid.WalkSpeed = p.Character.Humanoid.WalkSpeed + 10
- speedminus.MouseButton1Down:connect(function()
- p.Character.Humanoid.WalkSpeed = p.Character.Humanoid.WalkSpeed - 10
- jumpplus.MouseButton1Down:connect(function()
- p.Character.Humanoid.JumpPower = p.Character.Humanoid.JumpPower + 10
- jumpminus.MouseButton1Down:connect(function()
- p.Character.Humanoid.JumpPower = p.Character.Humanoid.JumpPower - 10
- bypass.MouseButton1Down:connect(function()
- game.Players.LocalPlayer.Character.ClientInputHandler.Disabled = true
- game.Players.LocalPlayer.CharacterAdded:connect(function()
- game.Workspace:WaitForChild(game.Players.LocalPlayer.Name)
- game.Players.LocalPlayer.Character.ClientInputHandler.Disabled = true
- local message = Instance.new('Message',game.Workspace)
- wait(2)
- end)
- -- Disable Bypass Taser , Arrest
- game.Players.LocalPlayer.Character.ClientInputHandler.Disabled = false
- game.Players.LocalPlayer.CharacterAdded:connect(function()
- game.Workspace:WaitForChild(game.Players.LocalPlayer.Name)
- game.Players.LocalPlayer.Character.ClientInputHandler.Disabled = false
- end)
- -- Get Tools On the Floor
- for i, v in pairs(game.Workspace['Prison_ITEMS'].single:GetChildren()) do
- v:MoveTo(game.Players.LocalPlayer.Character.Torso.Position)
- end)
- -- Prison Function
- game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(900, 97, 2400)
- Neutral.MouseButton1Down:connect(function()
- Workspace.Remote.TeamEvent:FireServer('Medium stone grey')