Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
admin:indexing:text:retrieve [2011/01/25 20:56]
els
admin:indexing:text:retrieve [2016/06/28 22:38] (current)
Line 8: Line 8:
 [[admin:​indexing:​text:​home|Overview]] |  [[admin:​indexing:​text:​home|Overview]] | 
 [[admin:​indexing:​text:​clob|Textual Datatypes]] |  [[admin:​indexing:​text:​clob|Textual Datatypes]] | 
-[[admin:​indexing:​text:​retrieve|External Files]] | +**[[admin:​indexing:​text:​retrieve|External Files]]** 
 [[admin:​indexing:​text:​proximity|Proximity Searches]] |  [[admin:​indexing:​text:​proximity|Proximity Searches]] | 
 +[[admin:​indexing:​text:​advanced|Advanced Searches]] | 
 [[admin:​indexing:​text:​results|Displaying Results]] |  [[admin:​indexing:​text:​results|Displaying Results]] | 
 [[admin:​indexing:​text:​relevancy|Relevancy]] [[admin:​indexing:​text:​relevancy|Relevancy]]
Line 17: Line 18:
 ==== Retrieving External Files ==== ==== Retrieving External Files ====
  
-Omnidex allows a table to point to a collection of external text files.  ​Some of the columns in the table can contain ​information about an external text file.  When the table is read, the text from the external file is retrieved and presented as a large text column in the table. ​ In this manner, queries against the table can also include criteria against the contents of the external files.  ​+Omnidex allows a table to point to a collection of external text files.  ​One of the columns in the table can contain ​the filename of an external text file.  When the table is read, the text from the external file is retrieved and presented as a large text column in the table. ​ In this manner, queries against the table can also include criteria against the contents of the external files.  ​
  
 Omnidex allows this by using an [[admin:​features:​expressioncols:​home|Expression-based Column]]. ​ An expression-based column is a virtual column declared in the table that does not exist in the underlying relational table or raw data file.  Instead, the column is fulfilled by a SQL expression each time a row is read.  Omnidex provides a [[dev:​sql:​functions:​retrieve_file:​home|$RETRIEVE_FILE]] SQL function that can be used in an expression-based column.  ​ Omnidex allows this by using an [[admin:​features:​expressioncols:​home|Expression-based Column]]. ​ An expression-based column is a virtual column declared in the table that does not exist in the underlying relational table or raw data file.  Instead, the column is fulfilled by a SQL expression each time a row is read.  Omnidex provides a [[dev:​sql:​functions:​retrieve_file:​home|$RETRIEVE_FILE]] SQL function that can be used in an expression-based column.  ​
  
-The $RETRIEVE_FILE function references ​another ​column in the table that contains the filename. ​ When the function is processed for each row, the file will be open and the contents ​will be deposited into the expression-based column. ​ The expression-based column can then be indexed and queried as needed.+The $RETRIEVE_FILE function references ​column in the table that contains the filename. ​ When the function is processed for each row, the respective ​file is opened ​and the contents ​are deposited into the expression-based column. ​ The expression-based column can then be indexed and queried as needed.
  
-<​code ​sql+=== Sample Database === 
-create table          "LIBRARY+ 
- ​physical ​            ​"dat/library.dat"+To demonstrate the $RETRIEVE_FILE function, and to provide examples for this section, we will use the following BOOKS table, which catalogs popular books. 
 +  
 +<​code>​ 
 +create environment ​             
 + ​in ​                           "​books.xml"​ 
 + ​with ​                         delete; 
 + 
 +create database ​               "​TEXT"​ 
 + ​type ​                         file 
 + ​index_directory ​              "​idx"​ 
 + ​in ​                           "​books.xml";​ 
 + 
 +create table                   ​"BOOKS"​ 
 + ​options ​                      "​delimited
 + ​physical ​                     "dat/books.txt"
  (  (
-  "​DOC_ID" ​           ​INTEGER ​               ​omnidex, +  "​DOC_ID" ​                          character(8) ​  omnidex, 
-  "TITLE" ​            CHARACTER(80         ​fulltext+  "CLASS" ​                           ​character(4  omnidex
-  "SUBTITLE" ​         ​CHARACTER(80         ​fulltext+  "FICTION" ​                         ​character(1  omnidex
-  "AUTHOR_FIRST_NAME" ​CHARACTER(32)          ​quicktext+  "LANGUAGE" ​                        character(32)  ​omnidex
-  "AUTHOR_LAST_NAME" ​ ​CHARACTER(32         ​quicktext+  "TITLE" ​                           ​string(80    fulltext
-  "FILENAME" ​         ​CHARACTER(32), +  "AUTHOR" ​                          string(80    fulltext ​  usage "​NAME"​
-  "CATALOG_DATE" ​     ​CHARACTER(80), +  "SOURCE" ​                          string(80)     quicktext
-  "LANGUAGE" ​         ​CHARACTER(16         quicktext,​ +  "FILENAME" ​                        string(255   quicktext,​ 
-  "​CONTENT" ​          C STRING(16MB        ​fulltext +  "​CONTENT" ​                         ​string(1MB   fulltext ​  usage "​TEXT"​ 
-    as "​$retrieve_file(FILENAME,​ 'STRING(16MB)'​)",​+   ​as "​$retrieve_file(FILENAME,​ '​STRING(1MB)'​)"​
 +  constraint DOC_ID_PK primary ("​DOC_ID"​),
  )  )
- ​in ​                  ​"library.xml"+ ​in ​                           "books.xml";
 </​code>​ </​code>​
  
 
Back to top
admin/indexing/text/retrieve.1295989009.txt.gz · Last modified: 2016/06/28 22:38 (external edit)