Identifying which tokens/columns matched in a MULTI_COLUMN_DATASTORE Index

Hello there,
I have a multi-column datastore text index. I am searching this index with a variant of the following relaxed progressive search:
SELECT SCORE(1), TEST_MV.*
  FROM TEST_MV
WHERE country_code = 'AU'
   AND CONTAINS(vehicle_text,
                '<query>
                  <textquery>
                   <progression>
                    <seq>{ford}*3 AND {falcon}*3 AND {2012}*3 AND {SEDAN}*3 AND {blah1} AND {BLAH2} AND {xr6} AND {turbo} AND {test} AND {manual} AND {limited} AND {edition}</seq>
                    <seq>{ford}*3 ACCUM {falcon}*3 ACCUM {2012}*3 ACCUM {SEDAN} ACCUM {xr6}*4 ACCUM {turbo} ACCUM {test} ACCUM {manual} ACCUM {limited} ACCUM {edition}</seq>
                   </progression>
                  </textquery>
                 </query>', 1) > 40
ORDER BY SCORE(1) DESC;Each column in the underlying table will correspond to one or more of the words in the CONTAINS function above. I won't necessarily know which words will correspond to which column at runtime. It is quite possible that the entire text string will be populated with unknown words that will attempt to be matched to the text index. Once a match is found, I would like to know which of the underlying column names:contained text were actually matched.
I am new to text indexing, and am trying to find the most elegant way to accomplish this goal. The following OTN post has given me an idea:
How can I find out what word fuzzy search matched
I just wondered if anybody else has encountered this requirement, and what kind of solution you chose? Also curious if Oracle support/development staff have any opinions and/or elegant solution recommendations?
Many thanks in advance for any responses.
James

Hi Barbera,
Thanks for such a quick response. I was actually thinking of a solution similar to the Materialised View "Pivot" Solution you provided in that post, i.e.
>
Another method would be to take an entirely different approach and use a materialized view, as demonstrated below with two columns of two tables. I didn't miss your other questions. I just hadn't gotten to them yet. I respond inbetween doing other things and sometimes it takes a while to think about something and put together a good example.
>
Rather than text indexing a pivoted materialised view, I am thinking of taking the strongest matching row from the text query result set against the multi-column data store, pivoting that into a global temp table containing column name and value columns, and then just matching the matched words against the global temp table in memory in order to get the column names. One of a number of reasons I want the column names is for the building of an IOT RefData table I can hit before the text index, which will contain known column names and values along with an associated (and configurable) weighting value to give each word when searching the text index. Additionally, if I can build up enough RefData, I may be able to avoid needing to hit the text index in the first place (Can't really properly explain that statement without going into a lot of detail about what I'm doing though).
I did think about pivoting the entire data set on which I've created the text index (to build a column_name:column_value materialised view). However, based on the nature of the data I'm matching, I'm thinking this may be overkill for what I'm doing.
Many thanks for your response. It is always interesting and insightful to discuss these issues on here. It would be great if Oracle were to provide a built-in that would return the multi-column datastore column names that were matched though. ;)
Cheers.
James

Similar Messages

  • SQL Query to find Receipt No.s which are not matched to AP Invoices

    Hi
    Please help me to frame a query to find list of Receipt No.s which are not matched with AP Invoices.
    Please refer to the below query .
    SELECT
    poh.segment1 "PO No.",
    aps.vendor_name "Supplier Name",
    pol.item_description "Item Description",
    rcvh.receipt_num "GRV No.s",
    rcvl.quantity_received "Quantity",
    pol.unit_price "Rate/Unit",
    rcvtl.tax_name||' - '||initcap(rcvtl.tax_type) "Tax",
    (rcvl.quantity_received * pol.unit_price) + nvl(rcvtl.tax_amount,0) "Amount"
    FROM
    po_headers_all poh,
    po_lines_all pol,
    po_distributions_all pod,
    ap_suppliers aps,
    rcv_shipment_headers rcvh,
    rcv_shipment_lines rcvl,
    rcv_transactions rcvt,
    jai_rcv_line_taxes rcvtl
    WHERE
    poh.po_header_id = pol.po_header_id
    AND poh.po_header_id = pod.po_header_id
    AND pol.po_line_id = pod.po_line_id
    AND aps.vendor_id = poh.vendor_id
    AND aps.vendor_id = rcvh.vendor_id
    AND rcvh.shipment_header_id = rcvl.shipment_header_id
    AND poh.po_header_id = rcvl.po_header_id
    AND pol.po_line_id = rcvl.po_line_id
    AND rcvh.shipment_header_id = rcvt.shipment_header_id
    AND rcvl.shipment_line_id = rcvt.shipment_line_id
    AND poh.po_header_id = rcvt.po_header_id
    AND pol.po_line_id = rcvt.po_line_id
    AND aps.vendor_id = rcvt.vendor_id
    AND rcvh.shipment_header_id = rcvtl.shipment_header_id
    AND rcvl.shipment_line_id = rcvtl.shipment_line_id
    AND rcvt.transaction_id = rcvtl.transaction_id
    AND aps.vendor_id = rcvtl.vendor_id
    AND rcvt.transaction_type = 'RECEIVE'
    AND poh.authorization_status = 'APPROVED'
    AND poh.segment1 = '210001079'
    I have'nt included the Invoice Tables in the above query.
    Please help me in that area.
    This is bit urgent.
    Please help me.
    Regards
    Nakul Venkatraman

    I am using ORACLE 11gR2 If you're licensed for Diangnostics pack then you might want to look at the AWR tables, e.g. DBA_HIST_SQLSTAT and cross-reference with DBA_HIST_SNAPSHOT.
    By this will i get the top 5 consumed queries of DEV user in the whole session or its just the top 5 queries at that particular time. The "executions" columns in this query, does it mean that the no. of. times the query has executed... This will get you a random 5 queries that were first parsed by DEV. Depending on your application code/structure, it may well be that all code (except for system-recursive sql) executed by DEV is parsed by DEV, and all code parsed by DEV is executed by DEV but this isn't true for all.
    In terms of top N queries, you need to ORDER BY and then restrict by ROWNUM at an outer level to the ROWNUM otherwise the ROWNUM filter is applied before the ORDER BY.
    i.e.
    SELECT *
    FROM
    (SELECT ...
    FROM ...
    WHERE
    ORDER BY...)
    WHERE ROWNUM <= ....
    The "executions" columns in this query, does it mean that the no. of. times the query has executedYes.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e25513/dynviews_3064.htm#REFRN30259
    Edited by: Dom Brooks on Oct 24, 2011 9:45 AM

  • Using ODBC how do you identify a calculated column in a table?

    I've a calculated column in my table. Is there a way to identify that column through ODBC functions? I need to identify the  calculated column and make it read only. The function should support both SQL and Access databases. Please let me know if
    there is a way to find out this column type.

    Hello,
    You can refer to the following article which list some ODBC Scalar Functions which you can used in the T-SQL query statement.For example
    SELECT {fn TRUNCATE( 100.123456, 4)};
    -- Returns 100.123400
    Reference:http://msdn.microsoft.com/en-us/library/bb630290.aspx
    As per my understanding, there is no built in declarative support for read-only columns. You can try to create a UPDATE trigger to achieving this. Or you can create a view with derived column  from the source table. And then users cannot
    update this calculated column on the view.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • How to identify which privilege is missing?

    Hi,
       If any query comes out with insufficient privileges, how do we identify which privilege is missing instead of searching in Oracle docs. Is there any table(dict or oracle internal) we can take aid to find out required privilege.

    Oracle does not store (other than the document) the possible privileges that could be granted to a specific user/object. But the privileges that are granted can be viewed in dictionary tables listed below.
    SQL> select *
      2    from dictionary
      3   where table_name like '%PRIV%'
      4   order
      5      by table_name;
    TABLE_NAME                     COMMENTS
    ALL_COL_PRIVS                  Grants on columns for which the user is the grantor, grantee, owner,
                                    or an enabled role or PUBLIC is the grantee
    ALL_COL_PRIVS_MADE             Grants on columns for which the user is owner or grantor
    ALL_COL_PRIVS_RECD             Grants on columns for which the user, PUBLIC or enabled role is the grantee
    ALL_REPGROUP_PRIVILEGES        Information about users who are registered for object group privileges
    ALL_TAB_PRIVS                  Grants on objects for which the user is the grantor, grantee, owner,
                                    or an enabled role or PUBLIC is the grantee
    ALL_TAB_PRIVS_MADE             User's grants and grants on user's objects
    ALL_TAB_PRIVS_RECD             Grants on objects for which the user, PUBLIC or enabled role is the grantee
    COLUMN_PRIVILEGES              Grants on columns for which the user is the grantor, grantee, owner, or
                                    an enabled role or PUBLIC is the grantee
    DBA_AQ_AGENT_PRIVS
    DBA_COL_PRIVS                  All grants on columns in the database
    DBA_PRIV_AUDIT_OPTS            Describes current system privileges being audited across the system and by user
    DBA_REPGROUP_PRIVILEGES        Information about users who are registered for object group privileges
    DBA_ROLE_PRIVS                 Roles granted to users and roles
    DBA_RSRC_CONSUMER_GROUP_PRIVS  Switch privileges for consumer groups
    DBA_RSRC_MANAGER_SYSTEM_PRIVS  system privileges for the resource manager
    DBA_SYS_PRIVS                  System privileges granted to users and roles
    DBA_TAB_PRIVS                  All grants on objects in the database
    GV$ENABLEDPRIVS                Synonym for GV_$ENABLEDPRIVS
    ROLE_ROLE_PRIVS                Roles which are granted to roles
    ROLE_SYS_PRIVS                 System privileges granted to roles
    ROLE_TAB_PRIVS                 Table privileges granted to roles
    SESSION_PRIVS                  Privileges which the user currently has set
    TABLE_PRIVILEGES               Grants on objects for which the user is the grantor, grantee, owner,
                                    or an enabled role or PUBLIC is the grantee
    USER_AQ_AGENT_PRIVS
    USER_COL_PRIVS                 Grants on columns for which the user is the owner, grantor or grantee
    USER_COL_PRIVS_MADE            All grants on columns of objects owned by the user
    USER_COL_PRIVS_RECD            Grants on columns for which the user is the grantee
    USER_REPGROUP_PRIVILEGES       Information about users who are registered for object group privileges
    USER_ROLE_PRIVS                Roles granted to current user
    USER_RSRC_CONSUMER_GROUP_PRIVS Switch privileges for consumer groups for the user
    USER_RSRC_MANAGER_SYSTEM_PRIVS system privileges for the resource manager for the user
    USER_SYS_PRIVS                 System privileges granted to current user
    USER_TAB_PRIVS                 Grants on objects for which the user is the owner, grantor or grantee
    USER_TAB_PRIVS_MADE            All grants on objects owned by the user
    USER_TAB_PRIVS_RECD            Grants on objects for which the user is the grantee
    V$ENABLEDPRIVS                 Synonym for V_$ENABLEDPRIVS

  • Update trigger: identify which field changed

    Is there any way to identify which field was changed when an update trigger fires? I need to be able to update another field if any field excluding 1 was changed.
    Something like
    for each field in :new
    if field.name != "dateref" then
    if field.modified then
    altered=true
    exit for
    endif
    endif
    next
    if altered then :new.updatetype="A"

    This will do it
    CREATE OR REPLACE my_trigger BEFORE UPDATE
    OF col2, col3, col4 ON my_table FOR EACH ROW
    BEGIN
      :new.updatetype='A';
    END;
    /If your table has a lot of columns this will be a bit of a drag to type all those column names. Unfortunately, as far as I know, there is no OF ALL COLUMNS EXECPT col1 ON
    syntax.
    Cheers, APC

  • How to update table which has column name as Oracle keyword?

    Hi All,
    Somebody has created one table which has column name as "OPTION", now i am trying update this table column value and its throwing an error. "Invalid Identifier".
    Could you please help me in this?
    Thanks in advance.
    Regards,
    Ganesh Patil

    check this :
    batch@DOLN1> create table "from" ("select" varchar2(10));
    Table created.
    batch@DOLN1> desc "from";
    Name                                                                                                  Null?    Type
    select                                                                                                         VARCHAR2(10)
    batch@DOLN1> update "from" set "select" = 'hello World';
    0 rows updated.
    batch@DOLN1> insert into "from" values('hello World');
    insert into "from" values('hello World')
    ERROR at line 1:
    ORA-12899: value too large for column "TCM_BATCH"."from"."select" (actual: 11, maximum: 10)
    batch@DOLN1> update "from" set "select" = 'hello';
    0 rows updated.
    batch@DOLN1> insert into "from" values('hello');
    1 row created.
    batch@DOLN1> commit;
    Commit complete.
    batch@DOLN1> update "from" set "select" = 'World' where "select" = 'hello';
    1 row updated.
    batch@DOLN1> select * from "from";
    select
    World

  • Identifying which part of stored procedure is taking long time

    Hi Everyone,
    I have a stored procedure which is taking long time to execute.  I am trying to understand which part/query in the stored procedure is taking long time.
    It involves lots of table variables and n no of queries .Could anyone please help me in how to identify which query/part of the stored procedure is taking long time to execute?
    Thanks in Advance

    Hi Vivek -
    I am only familiar with running the plan visualization for a single SQL query.
    Could you please guide me how to run it for a procedure.
    Thanks in Advance.

  • Can you identify which of your iOS Apps are free?

    I have a few hundred apps now in my iTunes library, and would like to identify which ones are free vs which ones cost money.
    Both my iPhone and my wife's are currently tied to the same iTunes account.  I want to create a new acount for her, but don't want her to lose all the purchased apps she uses.
    For music/movies/tv shows, I know I can authorize play on her new machine, but I don't believe you can for the apps...or at least she won't be able to download updates for them without logging out and logging into the old account.
    Any ideas?
    thanks

    Hello,
    Just other users here like yourself, so Apple will not likely respond here, you need to contact them by other means.

  • How to identify which process in process chain executes in Batch and Dialog

    Hi, We want to identify which processes in process chain is running in Batch mode or Dialog mode. Is there any where we can identify this from any table or transaction. (Eg Loading, DTP loading, Attribute change run, deletion of index, deletion of overlapping request, AND process, ABAP program , Master Data loading, Full Load, Delta load, Hierarchy Save, Start Process).
    Regards
    Vishwanath

    Hi Vishwanth,
                      In Process Chain proces runs in background only.
    refer here......
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/7b/d4313b38bea774e10000000a114084/content.htm
    Thanks,
    Vijay.

  • SCCM issue - "LANG_LIST has some locales which does not match with the locale of serial number"

    I have a problem with the error "LANG_LIST has some locales which does not match with the locale of serial number" recurring.
    I am trying to install Acrobat XI Std silently by SCCM.
    I've used the Adobe Customisation Wizard to create a mst which include the volume serial number we have with our licence purchases. Note that I am in Australia. I use the command line in SCCM for the install as "msiexec /i "AcroStan.msi" TRANSFORMS="D&B_AcroStd.mst" /qn" which fails silently. If I install on a local machine using an admin command prompt and changing to /qb at the end, I get the aforementioned error.
    I have a few things to try and resolve, having searched the adobe forums and other forums for the solution. The mst is only trying to install US English & I have even gone so far as to use the direct editor in the customisation wizard and change some values in the property table to resolve this. In the property table I can confirm that LANG_SEL_DEFAULT = ENU, REGIONAL_LIST = ENU, LANG_LIST = en_US, ProductLanguage = 1033
    Is there a way to check the language specified for ym serial number?
    Bryndon

    Update on a couple of details:
    @Sabian,
    Thanks for the location, I've downloaded and then when I tried an install of the newly extracted msi (admittedly on the same computer) I got exactly the same issue. Of note though is that running /qf automatically brought up the same serial number and the same incorrectly spelled company name. Installing on another computer (freshly imaged) doesn't have those inputs already present under /qf. Next when I try using the transfrom (a new one) with /qr it gives an error of the serial number, displaying the entire serial.
    @Sebastian
    I've had a look through yours and it seems our issues could have the same origin. Looks like I may have to call customer support regarding the serial number as Sabian suggested in your thread.
    The bit that gets me is when the same serial number is used in a manual install (or /qf) then it installs ok without any errors.

  • How to identify which is rootsite/webapplication url and which are site collection url ?

    How to identify which is rootsite/webapplication url and which are site collection url underneath of web application using powershell script in following code?
    # Get site objects
    $webapplication = Get-SPWebApplication $siteUrl
    # Walk through each site in the site collection
    foreach($site in $webapplication.Sites)
    foreach($subWeb in $site.AllWebs)
    $_ = AddLevel123($subWeb.Url)

    Hi,
    Hope you wanted to know which API is Site collection (SPSite) and Sub site(SPWeb) 
    $webapplication.Sites = Site Collection (SPSite)
    and $site.AllWebs = Subsite (SPWeb)
    and see these links - to get webApplication URL
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/e223b607-ab35-454a-a050-1db3005687e5/spwebapplication-url?forum=sharepointdevelopmentlegacy
    SPSite Url - SPSite.Url (http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.spsite.url.aspx)
    SPweb URl - SPWeb.URL (http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.spweb.url.aspx)
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/b4dfb645-69f4-4abd-947c-64ca42af3a26/script-to-get-list-of-sites-and-subsites
    Hope this helps!
    MCITP: SharePoint 2010 Administrator
    MCTS - MOSS 2007 Configuring, .NET 2.0
    | SharePoint Architect | Evangelist |
    http://www.sharepointdeveloper.in/
    http://ramakrishnaraja.blogspot.com/

  • How to identify which videos

    I took a dozen or so short clips of an event. I know which three I want to combine and edit. But I can't figure out how to identify which they are in imovie in order to put those clips in my project. It shows them all as consecutive clips or frames, without file numbers or names.

    I'll try to explain better.
    A dozen clips or videos, 1 min to 5 min in length. In one case all along a mountain road.
    I want to produce a 5 min project or video with the best parts of 3 of those 12.
    All 12 have thumbnails almost identical (the dashboard across the bottom, roof line at the top)
    I only want to start editing the 3, not put all 12 in.
    How do I identify those 3?

  • How to Identify which Source Row is causing a slowdown in the Indexing?

    Every so often the Indexing seems to hit a wall and we gaet a huge backlog of text files that need to be indexed. We get about 2 to 3 million files per day. Most of the time the problem gets resolved when we increase the degree parallel. How can we identify which text file is causing the problem?
    Regards

    I wonder if the problem is becuse of some bug when the DR$PENDING gets to zero rows. Apparently this causes the query on CTX_USER_PENDING to take a long time. I use that view to determine the partitions to pass to SYNC_INDEX procedure.
    select
    pnd_partition_name
    ,count(*)
    from ctx_user_pending
    where pnd_index_name = '<index_name>'
    group by
    pnd_partition_name
    /This takes about 5 seconds for tow rows with 335 and 13 rows.
    Tables DR$INDEX, DR$INDEX_PARTITION and DR$PENDING have had Statistics gathered
    This query has taken over 45 minutes.

  • How to identify Which function modules are used in the planning area?

    Hi all,
    there are couple of function module derviation is used to derive the calendar year, month, fiscal period etc.
    But how to identify which function module is used in which planning area?
    I cant find out from the where used list from function modules?
    Thanks
    pooja

    Hi Pooja,
    Go to characteristic relationship tab,click on detail icon on extreme left of the derivation,there you will get the name and the details of function module used for derivation.
    Regards,
    Indu

  • How to identify Which ports are using in RAC setup?

    Hi,
    how to identify Which ports are using in RAC setup?
    Thnaks,

    [Viewing Port Numbers and Access URLS|http://download.oracle.com/docs/cd/B19306_01/install.102/b14205/ports.htm#sthref1208]

Maybe you are looking for