Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Search in all articles #185

Closed
r1z1 opened this issue May 18, 2013 · 18 comments
Closed

Search in all articles #185

r1z1 opened this issue May 18, 2013 · 18 comments

Comments

@r1z1
Copy link

r1z1 commented May 18, 2013

It would be great to have a search in all articles by title or contains maybe.

@BernhardPosselt
Copy link
Contributor

Search is very hard to do well therefore low priority ;)

@cosenal
Copy link
Contributor

cosenal commented May 24, 2013

Can you remind me what was the problem with using the oC Search API?

@BernhardPosselt
Copy link
Contributor

I think it will be abolished. The current one leads to very high loadtimes and causes bad userexperience (lucene). The implementation we had before didnt fully use this btw. It also depends on #132 and would require us to implement routes for each item (which will be very hard to do i think)

@knasdk
Copy link

knasdk commented May 29, 2013

I'd say that a simple search in the body column would be a great help!

@BernhardPosselt
Copy link
Contributor

Like I said, will take a longer time. The searchbar has also to go somewhere, we unfortunately cant use the one in the top. That would mean we have to add another bar on top of the articles @jancborchardt

@knasdk
Copy link

knasdk commented May 29, 2013

I see... Maybe it didn't have to be integrated like that. It could be a field either on top of the news feed list (to the left) or under - or maybe placed under the "tools" slider - where import/export is located...

@BernhardPosselt
Copy link
Contributor

Should be on top of the articles so its obvious :)

@knasdk
Copy link

knasdk commented May 30, 2013

It's like - we can't walk, but wanna fly, so we keep crawling... Think smart buddy. We need that function. I can do it myself, but then I can't update when you enrich us with new features...

@jancborchardt
Copy link
Contributor

@knasdk we know that feature would be nice, but we have other priorities at the moment. If you can do it yourself, please do so and issue a pull request to help everyone. And if you add the search bar, please add it on top of the articles (app-content) so it’s obvious what is searched. Then the articles should be filtered as-you-type.

@nldmn
Copy link

nldmn commented Mar 20, 2015

Hi all, a search on all articles would be highly appreciated. IMO its a must have for a news app, considering you have plenty of feeds and want to search specific terms etc.

I would be happy to contribute to get a search implemented into the app.

@kgraefe
Copy link
Contributor

kgraefe commented Mar 20, 2015

Is the need for a separate search bar still valid since ownCloud 8 changed the search bar at the top to be app-specific?

@BernhardPosselt
Copy link
Contributor

@kgraefe did not know of that change, can you link me something? But apparently it does not load anything which means it should be possible to reuse the top search. This will simplify things.

@kgraefe
Copy link
Contributor

kgraefe commented Mar 20, 2015

https://owncloud.org/blog/owncloud-server-8-0-for-users/ (paragraph "Improved search")

@BernhardPosselt
Copy link
Contributor

In general we want full text search on the database level. Since we store HTML markup in the database (item's body field) we need to get rid of it and keep it in a separate column. We can also append the title and link to the text, so we need to create a duplicate column where we can run the search queries on. @fossxplorer is gonna hate me xD

These columns need to be created properly, otherwise you'll only be able to search in new entries. For bigger systems this can take hours, so this migration will be optional. We are going to need to do the following:

  • Create a migration command, e.g.: php -f console.php news:create_serach_index that goes through all the previous entries with an empty column and creates an index.

  • The index field's content is created like this:

    $index = strtolower(strip_tags($body) . ' ' . strip_tags($title) . ' ' . $link)
  • The controller method that returns the items is going to take another parameter called search. That parameter is, when passed to the database layer turned into an SQL command, e.g.: ?search=test%20string will be turned into

    WHERE searchindex LIKE '%test%' AND searchindex LIKE '%string%'

    We need to take care of proper escaping.

  • Clientside the search term will be reflected in the URL, e.g. #/items/?search=test%20string. That way we can do a simple route redirect and refresh the content area. The input field will have a 300-500ms delay to not reload to often

@BernhardPosselt
Copy link
Contributor

Work on this will be done in the next branch which aims for 8.1

I cant guarantee however that this is finished when 8.1 is released.

@BernhardPosselt
Copy link
Contributor

@BernhardPosselt BernhardPosselt modified the milestones: next, Dreamland Mar 20, 2015
@BernhardPosselt
Copy link
Contributor

Clientside search is implemented in the next branch, all that is left is the migration for older articles and some testing :)

BernhardPosselt pushed a commit that referenced this issue Mar 21, 2015
@BernhardPosselt BernhardPosselt removed this from the next milestone Mar 21, 2015
BernhardPosselt pushed a commit that referenced this issue Mar 21, 2015
@jancborchardt
Copy link
Contributor

@Raydiation btw – you can use the header search field for this. In Files, apps mgmt etc we moved to use the filed for in-app search. :)

@BernhardPosselt BernhardPosselt added this to the 8.1 milestone Mar 30, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants