Description
With Xapian Search the FullSearch and PageList Macro always shows attachment, too.
If you use the PageList Macro you don't want to get also attachment displayed in your pagelist. Or in my eyes you should be able to disable/enable this "feature" (like -mimetype:*).
- Only displaying pdf is working with a syntax like mimetype:application/pdf
So maybe the wiki page should be a mimetype too. I talked about this to ThomasWaldmann on #moin.
Steps to reproduce
- Create some pages
Upload a lot of PDF files and try out some PageList <<PageList(Python)>> or a FullSearch with title:
interesting is that only searching for pdf works <<FullSearch(tilte:python mimetype:application/pdf)>>
http://lotek.heavy.ch/PageListWithAttachments
Example
Component selection
- xapian, mimetypes
Details
MoinMoin Version |
1.6.3 |
OS and Version |
linux |
Python Version |
2.5.2 |
Server Setup |
WSGI Apache2 |
Server Details |
Xapian and PyStemmer |
Language you are using the wiki in (set in the browser/UserPreferences) |
de |
Workaround
using - (NOT) for every mimetype you don't want to see in your PageList:
<<FullSearch(title:python -mimetype:application/pdf -mimetype:application/zip -mimetype:application/x-bzip2 -mimetype:application/octet-stream)>>
- using something like -mimetpye:application/* doesn't work
Discussion
I'm using now some syntax like <<PageList(Python mimetype:text/wiki)>> is this correct (atleast it works on my example/test)?
if you only want to find #format wiki pages, yes.
Should this behavior for PageList not to be the default (not showing attachment)?
Well, as it is called PageList, yes. But otoh, we are transitioning to pages and attachments as items, so it will be ItemList in future anyway.
You said text/<format>; what other format are possible? only the stuff in "/MoinMoin/formatter/" ?
- yes, anything you have a parser for.
Would is this fix compatible with using sometimes xapain and sometimes only moinmoin_search (just wondering)?
since latest changeset in 1.7: yes
Xapian need exact match of the MimeType
There is now an other problem, if I want to find e.g only PDFs:
Using FindPage and set the mimetype to "application" (anyway - no sane user whould scroll hundreds of mimetypes to find the .pdf; there it would be better to display only the name of the mimetype)
adding some text like python and go
no files found (mimetype=application)
pdf files found (change - mimetype=application/pdf)
ideas:
It should be possible to allow searches for only the group mimetype e.g. application, audio files, etcetera (atleast if they're still be displayed in the FindPage form)
- the detail mimetypes should be displayed like "pdf (application/pdf)" so it would be possible to type the first letters in the box/form to find it.
- the user don't know how he can search for only wiki pages (or just hiding the attachments), maybe it should show up as mimetype (wiki) or even better another checkbox for "don't display attachments".
Enviroment: Using latest changeset for MoinMoin1.6.x, Xapian 1.0.4 and PyStemmer 1.0.1
Should I fill this as a new bug report?
- That's rather a feature request. For xapian search, the full mimetype is indexed, so if you want to find it, you have to search for the full mimetype.
Bug Report because the FindPage form offering something what Xapian not can handle, yet!
Feature Request because I would like to have a more flexible mimetype searching
Plan
- Priority:
- Assigned to:
- Status: workaround:
http://hg.moinmo.in/moin/1.7/rev/a53307694ba3 Xapian mimetype search: consistently use a Keyword for mimetype, use text/<format> as mimetype for pages
http://hg.moinmo.in/moin/1.6/rev/1829d890e862 same for 1.6
http://hg.moinmo.in/moin/1.7/rev/25822f14e4ea mimetype search for builtin search
http://hg.moinmo.in/moin/1.6/rev/f2a31195668e same for 1.6