perkeep / perkeep

Perkeep (née Camlistore) is your personal storage system for life: a way of storing, syncing, sharing, modelling and backing up content.
https://perkeep.org/
Apache License 2.0
6.47k stars 446 forks source link

pkg/search: should search expressions only match permanodes? #944

Open mpl opened 7 years ago

mpl commented 7 years ago

I've just realized that search expressions, when parsed, are logically "anded" to

base := &Constraint{
    Permanode: &PermanodeConstraint{
        SkipHidden: true,
    },
}

so that they only match permanodes.

This hadn't really been a problem so far, until the introduction of the "ref:" predicate, used in particular for map queries. It is of no consequence when the predicate is used in the map apsect, because we're only interested in permanodes there.

However, I took the opportunity to replace as well the

queryAsBlob_: function(blobRef) {
    return {
        blobRefPrefix: blobRef,
    }
},

uses in index.js with a "ref:" predicate, which means the web UI is now broken for when one wants to get the Blob aspect of a (non-permanode, e.g. file schema) blob.

The above is easy to revert, but it does open the question about whether we always want a search expression to only match permanodes. Or even if we ever want to force it to.

In addition, I'm also working (pretty much done) on a new directories/files browsing aspect, which does rely as well on non-permanode blob searches. Again, it's probably a non issue if we revert the above, and simply use constraints instead of predicates when we want non-permanodes, but still.

If we do keep the current behaviour for search expressions, we should document it.

mpl commented 7 years ago

https://camlistore-review.googlesource.com/11066