Forum Stats

  • 3,876,264 Users
  • 2,267,083 Discussions
  • 7,912,487 Comments

Discussions

Display Oracle Text search results and download them as file

DannyS-Oracle
DannyS-Oracle Member Posts: 165
edited Dec 1, 2017 6:04PM in APEX Discussions

Hi everyone,


I am developing an internal search engine in my team, allowing my users to query data and download them as a file. So far I implemented this using the combination of Interactive Report (IR) and Oracle Text (OT):

  1. I used OT to handle the search terms and query the data
  2. I used IR to display the search results. It also allows my team to download search results using Actions > Download option. 

The problem with this approach is, the search results in IR table is not intuitive for my users because it is displayed in columns, and there are lots of them (>20 columns) which requires my users to scroll horizontally a lot. They prefer the results just like the Google search results UI:

  1. search keywords highlighted
  2. data displayed not in columns, but in structured format using HTML and CSS

I recently learned that I can format the search results in HTML and CSS to be more intuitive using CTX_DOC.MARKUP package. Now my only concern is, how can I provide the download option on top of this marked-up display? Is there an API or library to integrate the Apex' download feature with the OT search?

Any suggestion will be appreciated, thanks!

Scott WesleyDannyS-Oracle

Best Answer

  • fac586
    fac586 Senior Technical Architect Member Posts: 21,485 Red Diamond
    edited Nov 7, 2017 1:55AM Answer ✓
    DannyS-Oracle wrote:
    I am developing an internal search engine in my team, allowing my users to query data and download them as a file. So far I implemented this using the combination of Interactive Report (IR) and Oracle Text (OT):I used OT to handle the search terms and query the dataI used IR to display the search results. It also allows my team to download search results using Actions > Download option. The problem with this approach is, the search results in IR table is not intuitive for my users because it is displayed in columns, and there are lots of them (>20 columns) which requires my users to scroll horizontally a lot. They prefer the results just like the Google search results UI: search keywords highlighteddata displayed not in columns, but in structured format using HTML and CSSI recently learned that I can format the search results in HTML and CSS to be more intuitive using CTX_DOC.MARKUP package. Now my only concern is, how can I provide the download option on top of this marked-up display? Is there an API or library to integrate the Apex' download feature with the OT search?Any suggestion will be appreciated, thanks!

    Use a classic rather than an interactive report. This has built-in support for CSV download, or the default functionality can be replaced by a link to a download performed by an XML report page or a custom on-demand process.

    The win here is that there is already a Search Results report template that can be used with or instead of the CTX_DOC.MARKUP output.

Answers

  • Scott Wesley
    Scott Wesley Member Posts: 6,271 Gold Crown
    edited Nov 7, 2017 12:39AM

    You might have a column sourced from your ctx_doc.markup procedure. You will need to escape special characters on that column.

    You can set conditions on your IR columns to only download certain columns, vs what's displayed on the page.

    This may be enought to suit what you're chasing?

    DannyS-Oracle
  • fac586
    fac586 Senior Technical Architect Member Posts: 21,485 Red Diamond
    edited Nov 7, 2017 1:55AM Answer ✓
    DannyS-Oracle wrote:
    I am developing an internal search engine in my team, allowing my users to query data and download them as a file. So far I implemented this using the combination of Interactive Report (IR) and Oracle Text (OT):I used OT to handle the search terms and query the dataI used IR to display the search results. It also allows my team to download search results using Actions > Download option. The problem with this approach is, the search results in IR table is not intuitive for my users because it is displayed in columns, and there are lots of them (>20 columns) which requires my users to scroll horizontally a lot. They prefer the results just like the Google search results UI: search keywords highlighteddata displayed not in columns, but in structured format using HTML and CSSI recently learned that I can format the search results in HTML and CSS to be more intuitive using CTX_DOC.MARKUP package. Now my only concern is, how can I provide the download option on top of this marked-up display? Is there an API or library to integrate the Apex' download feature with the OT search?Any suggestion will be appreciated, thanks!

    Use a classic rather than an interactive report. This has built-in support for CSV download, or the default functionality can be replaced by a link to a download performed by an XML report page or a custom on-demand process.

    The win here is that there is already a Search Results report template that can be used with or instead of the CTX_DOC.MARKUP output.

  • DannyS-Oracle
    DannyS-Oracle Member Posts: 165
    edited Nov 28, 2017 11:25AM

    Thanks @fac586, the template works good. Just one quick question, how to show the CSV download? I enabled the CSV export, but the download link does not appear on the page, am I missing something? I attached a screenshot below.

    Screen Shot 2017-11-28 at 8.24.12 AM.png

  • fac586
    fac586 Senior Technical Architect Member Posts: 21,485 Red Diamond
    edited Dec 1, 2017 2:13AM
    DannyS-Oracle wrote:Thanks fac586, the template works good. Just one quick question, how to show the CSV download? I enabled the CSV export, but the download link does not appear on the page, am I missing something?

    No, the Search Results report template is. It does not include a download link.

    Instead of using the built-in template, create a copy of it and add support for a download link in the After Rows definition:

    <div class="t-Report-links">#CSV_LINK#</div>

    See the Standard report template for an example.

    Scott WesleyDannyS-OracleDannyS-Oracle
This discussion has been closed.