bookieio/Bookie

exclude tags in search

anarcat opened this issue · 8 comments

i'd like to be able to do searches in tags but exclude some tags in the search.

i would expect a search like todo -ignore to show me all entries tagged todo but not tagged ignore.

@mitechie
This seems interesting. I would like to work on this.
Should I create another field to enter tags that should be ignored or is there any other easy way?

Instead of ignoring some tags why not make the search more efficient.

@mitechie This seems like a nice idea, I don't think anyone is currently working on this so I would like to do it. My work would include -

  1. search works like python bookie -github so all tags containing python and bookie and not containing github will be shown.
  2. The color of the ignored tags in the search bar will change to red to show they are ignored.
    3.Writing unit tests for the above.

any progress here?

@anarcat Oops, My mistake, I had made some progress on it, but forgot about it, I will complete the above mentioned tasks and send a pull request in 2-3 days.

hey don't beat yourself up, thanks for doing this!! :)

@anarcat
Hi, I am facing some issues with sqlalchemy, basically , I took all the excluded tags in a list.
Then in https://github.com/bookieio/Bookie/blob/develop/bookie/models/__init__.py#L469
I added a 'NOT IN' functionality -

and_(
          Tag.name.in_(tags),
          Tag.name.notin_(tags_exclude),
          bmarks_tags.c.tag_id == Tag.tid
   )

tags_exclude is a list of tags to be excluded ( ['foo','bar'] )
But I am not getting the desired result. Any Pointers ?

could you send a pull request with what you have so far? i don't have time to review right now, but maybe others could, and having the complete set of changes will make it easier to provide help and feedback. thanks!