Note that there are some explanatory texts on larger screens.

plurals
  1. POUse search output string to open a local network file
    text
    copied!<p>I have been trying for ages with all types of "file, file_get_contents, fopen, opendir and etc" to acomplish what I am triying to do, but just no can do for me, this goes beyong my understanding, sadly. But here I am to learn. </p> <p>What I want to do? I work with LucidWorks, and I have built an Intranet search that searches the specific path given "C://example/example/..." and does a full text search through all the files. The output of the search on my intranet website is simple:</p> <ul> <li>Document title</li> <li>Body title with highlighted keyowrds</li> <li>Path to the file</li> </ul> <p>Now, that not being enough, my lazy fellow Companions would like to be able to click the Document title(which does indeed have a full path to the document behind it, just so you can picture it better "C:/Ex/ex/ex/docs/sap/text.txt(or any other termination)) and open it locally.</p> <p>Here is the part of the code that I believe to be relevant for what I am trying to acomplish. The "solution" i have built in does not work, but it may give you an idea of what I am trying to accomplish here.</p> <pre><code>$searchParams = array( 'hl' =&gt; 'true', 'hl.fl' =&gt; 'body' ); $response = $LWS-&gt;search($query, $offset, $limit, $searchParams); if ($response-&gt;response-&gt;numFound &gt; 0) { foreach ($response-&gt;response-&gt;docs as $doc) { ?&gt; &lt;div id="resultbox"&gt; &lt;span id="resulttitle"&gt; &lt;?php echo "&lt;a href={$doc-&gt;id}'&gt;{$doc-&gt;title}&lt;/a&gt;&lt;br /&gt;"; ?&gt; &lt;/span&gt; &lt;?php $content = (("{$doc-&gt;id}'&gt;{$doc-&gt;title}")); print_r( '&lt;a href= ' . fopen(str_replace('%', ' ', $content), "r+") . '&gt;Open File&lt;/a&gt;&lt;br /&gt;'); ?&gt; &lt;SPAN ID="copytext" &gt; &lt;?php echo substr($content, -100); ?&gt; &lt;br&gt;&lt;/SPAN&gt; &lt;div id="sbody"&gt; &lt;?php echo "..." . $response-&gt;highlighting-&gt;{$doc-&gt;id}-&gt;body[0] . "...&lt;br /&gt;&lt;br /&gt;"; } echo '&lt;br /&gt;'; return; } else { echo "No results for \"" . $query . "\""; return; } ?&gt; </code></pre> <p>There is a little bit more code above it, but it's irrelevant for the asked question.</p> <p>So there you go folks, I am hoping for help, and to be able to learn something new :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload