siyuan icon indicating copy to clipboard operation
siyuan copied to clipboard

changing fields displayed in search results (theming?)

Open manoflinux opened this issue 10 years ago • 10 comments

it seems to be pulling the info from the " <meta name="Author"" tag and displaying it. Unfortunately that is rarely set to anything useful and need to remove it from the result listing. I don’t mind it being search-able, I just don’t want it listed in the search results.

Know this is more of a request, but if you can tell me where in the code to modify I will just do it there till you guys get around to making an option for this.

manoflinux avatar Feb 05 '14 14:02 manoflinux

also I tried commenting out the lines that listed author as a field and restarted apache, but that did not seem to help. Great piece of software btw. I hardcoded the paths in my copy and got rid of the option to setup your own paths in the gui and its been working perfectly for over a year. I have recently expanded it from use on our intranet to a public website. The site owner said and I quote "The new search engine is beautiful!" Just wanted to pass that along, great work guys.

manoflinux avatar Feb 05 '14 14:02 manoflinux

I think that you can just remove the author div from views/result.tpl. Get rid of the following lines:

    %if d.has_key('author') and len(d['author']) > 0:
        <div class="search-result-author">{{d['author']}}</div>
    %end

Seems to work for me.

jf

ghost avatar Feb 05 '14 15:02 ghost

It is true that the "author" field is rarely used correctly in PDF files, but IMO it's just a matter of time before editors use it properly, like happened in mp3 files. I've been correcting my library's metadata using Calibre, although that's easier said than done...

However, as a feature, it would be great if it were possible to customize which fields that are shown in the result list, just like in recoll's interface.

wonx avatar Feb 05 '14 15:02 wonx

I was talking about html files, but I agree customizing the fields would be nice. Is there no easy way to make a single field not show up in the results?

manoflinux avatar Feb 06 '14 09:02 manoflinux

In the long run it would be nice to make it "theme-able" via sets of .tpls and .css but for the moment the codebase is a bit messy and there's much more than just basic layout in the templates which makes layout changes a bit of a pain.

That said, to repeat after medoc (you really are on it mate!): to change the layout in any way you've gotta edit the templates in views/ and/or the stylesheet at static/style.css. In the latter, it should be sufficient to add display: none to .search-result-author block. There's many other fields that you could hide in this manner too.

koniu avatar Feb 06 '14 12:02 koniu

Thanks!!! will try that out!

manoflinux avatar Feb 06 '14 14:02 manoflinux

It worked. Many thanks. I will let you know how it works as a production search engine for a public website. If there are any security holes you know about please let me know.

manoflinux avatar Feb 06 '14 21:02 manoflinux

You should know that this was not designed as a public web site tool as far as I know. I personnally don't know of any security issue, but I guess that it's mainly because I never looked for them, as far as I'm concerned this was always thought of as a LAN tool.

ghost avatar Feb 08 '14 09:02 ghost

The webui was intended as a local interface / intranet tool but security-wise I see little reason why it shouldn't be used on a public website. It's built on top of Bottle web framework which is meant to be safe to use in public production environments.

koniu avatar Feb 10 '14 14:02 koniu

I don't really disagree with koniu, but it's a fact that the whole package has not been audited. For example, I don't know if Botlle or Apache have a way to limit the resources used by a given request. It's probably possible to craft costly Recoll queries. The Python module has index modification functions. I have no reason to believe that they are accessible from the interface, but, as long as it has not been seriously verified, who knows ? etc. etc. I have no reason to believe that we've done a bad job, but the security aspect just has not been studied in depth.

ghost avatar Feb 10 '14 15:02 ghost