Common Oracle Text Search summarized by myself

Source: Internet
Author: User

Oracle TextText Retrieval: (you must first createContextOrCtxcatIndex, and then as follows) (you can alsoFromAdd, Score (10)To observe the score of the retrieved item)

1.Exact match of words
Select CBID, title (Column name) From emergency (Table Name) Where contains (title ,'About')> 0;YesfromTitleRetrieving words in"About"OfCBIDAndTitleField.

2. exact match of multiple words
select CBID, title form emergency where contains (title, ' about and request ')> 0; retrieve words from title " about " and " request " .
or select CBID, title form emergency where contains (title, ' about and request ' , null)> 0; it means the same as the preceding one. It is not a phrase but a word. Note that!

3. exact phrase match
select CBID, title ( column name ) from emergency ( table name ) Where contains (title, 'Doctor visits ', null)> 0; exact match doctor visits phrase
if you want to use and, or, minus and other reserved words, escape Character {} , for example, doctor {And} visits

4. search for words that are close to each other
select CBID, title ( column name ) from emergency ( table name ) Where contains (title, ' about near request ')> 0;
select CBID, title ( column name ) from emergency ( table name ) Where contains (title, 'near ( about , request ), 10) ')> 0; indicates that the specified two words are within 10 words

5.Use wildcards in search(Multi-character wildcard is%, The single-character wildcard is-)
Select CBID, title (Column name) From emergency (Table Name) Where contains (title, 'worker % ')> 0;YesWorkerIt can start with a single word and can be expanded at most.3Character

6.Fuzzy match search
Select CBID, title (Column name) From emergency (Table Name) Where contains (title ,'?About')> 0 ;(Add a question mark.)

7.UseAboutOperator to search the topic of a document
Select CBID, title form emergency where contains (title, 'about (Housing) ', Null)> 0;

Note that if you useContextThe text index is not updated when the base table is updated during indexing. To synchronize indexes, you must executeCtx_dllProgramPackageSync_indexThe process is as follows:
Execute ctx_dll.sync_index ('review _ Index ');

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.