koniu / recoll-webui

web interface for recoll desktop search
266 stars 55 forks source link

changing fields displayed in search results (theming?) #25

Open manoflinux opened 10 years ago

manoflinux commented 10 years ago

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 commented 10 years ago

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.

ghost commented 10 years ago

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

wonx commented 10 years ago

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.

manoflinux commented 10 years ago

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?

koniu commented 10 years ago

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.

manoflinux commented 10 years ago

Thanks!!! will try that out!

manoflinux commented 10 years ago

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.

ghost commented 10 years ago

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.

koniu commented 10 years ago

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.

ghost commented 10 years ago

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.