Commit Graph

339 Commits

Author SHA1 Message Date
Brad Fitzpatrick 15e583f6ea Merge "search: stronger lexer; parse errors contain a position" 2014-04-10 02:32:08 +00:00
Steven L. Speek d9cd746fc1 search: stronger lexer; parse errors contain a position
lexer and parser run concurrently
parser functions simplified

Change-Id: Ie6e47d975b254218509072886e87c120860e7a17
2014-04-06 19:30:47 +02:00
Joshua Gay 30e3d4e7af query.go: fix to skip over files returning IsNotExist errors on queries for width, height.
I am a first time committer and I am using the fix to issue number 402 as a bug to learn to learn how to commit to this process. I am not sure if this is the correct way to fix this bug -- the submitter of the bug believes it is -- so please review my code with scrutiny. Thank you.

Change-Id: I6c56b7866d530e1b1c66c563f201e6d1e13d3fa9
2014-04-03 20:43:19 -04:00
Steven L. Speek 3442076272 search: width and height exact matches simplified
corrected some copy paste errors in the expr_test
file

Change-Id: I36467d96c5674cddc34009d36a05c42ddd7e3cc2
2014-03-23 21:18:00 +01:00
Brad Fitzpatrick bf041c8955 search: escape r.AttrFilter in ClaimsRequest.URLSuffix
Change-Id: I90e5a87330dc6ae820f2f5f6e3887a26f341a2b2
2014-03-19 14:59:13 -07:00
Brad Fitzpatrick 0cbfae59e1 Merge "Added AttrFilter to ClaimsRequest" 2014-03-19 21:57:48 +00:00
Hernan Grecco 16d6bbb065 Added AttrFilter to ClaimsRequest
This allows server-side filtering of claims by claimtype

Change-Id: I1f5368c17f8f9f59ea0add7df67033447e37bc61
2014-03-19 00:45:33 -03:00
Steven L. Speek 146a42cc51 search: accept 'and', 'or', and parentheses in expressions
'and' has precendence over 'or'.
both operators are left associative
parenthesized expressions are evaluated first
Parser refactored, parseAtom split up.

Change-Id: I1f194cc75df49bad9d30d041d689d8ba833076f1
2014-03-18 16:40:44 -07:00
mpl 9cadbcd5bc publish: use generic queries
Use generic queries instead of specialized index queries. This is a step
towards the publisher app, because its client will have to use generic
queries.

Context: http://camlistore.org/issue/365

Change-Id: I2781a345e024174e3bea8511b6cdc6f342d5a7c1
2014-03-18 17:26:29 +01:00
Brad Fitzpatrick bf6031a397 search: add operator "childrenof:sha1-xxxxx" to find permanode children of a parent
Change-Id: I9e756147c70f5230aa843ab215dafe5ed6d80087
2014-03-13 19:02:26 -07:00
Brad Fitzpatrick bfa412de5d search: implement some of RelationConstraint (only the "parent" relation)
Allows searching for permanodes based on their parent(s).

Change-Id: I949f159edc43d895e1657bd6ae4c983758ac59f2
2014-03-13 18:49:28 -07:00
Brad Fitzpatrick bf48a198c8 search: add test for camliContentImage describing
Test was missing from bf5cc362b5

Change-Id: Ie42bef6f7cff19b69e3bad37f42b8d3a694d9a28
2014-03-10 20:11:32 -07:00
Brad Fitzpatrick bf5cc362b5 search: also describe camliContentImage
Change-Id: I64cd4818dead81f5a0dac0e275994df17b7740ef
2014-03-10 19:53:56 -07:00
Brad Fitzpatrick bfe5eafb44 search: remove check on negative search limit.
It's defined and implemented to mean infinite.

Change-Id: Ia50fd2b101d800ba442b4767ddf1c9bf57ea999f
2014-03-10 19:31:33 -07:00
Brad Fitzpatrick bf6d91545c search: remove expr TODO
Change-Id: Iea7826f2924ad229585a1ec3921fceb6130e8207
2014-03-08 21:11:03 -08:00
Steven L. Speek b326c2db11 attribute search
Change-Id: I9638ca9ef325076122721c601aade05ce99c0c24
2014-03-08 20:58:42 +01:00
Brad Fitzpatrick 2b27dd53c0 Handle Photoshop images better.
We still can't find their width/height or thumbnail the, but at least
we don't wedge the UI now.

Fixes camlistore.org/issue/389

Change-Id: I8af6cefa5d84e7f6e26f3920e4dd6e1d5eb8b192
2014-03-04 10:58:51 -08:00
Aaron Boodman 5a1e831a7b Bump is:pano threshold to 2.0.
Previous value of 1.6 was too small because iPhone 5's aspect ratio
is 1.78, meaning all landscape iPhone 5 photos were included in
is:pano. Same with Moto-X and probably other newer phones.

I tried 1.8, but it still "felt" too small. I think the correct
value is atleast 2.0, but perhaps larger. I don't have enough test
data in that range right now to get a good feel for it.

Change-Id: I6a3e054290d6f434afac8142a9abc68e53008229
2014-02-08 15:48:29 -08:00
Brad Fitzpatrick b15cde9bce Merge "pkg/search: Add durationms to MediaTagConstraint comment." 2014-01-26 18:45:33 +00:00
Daniel Erat ef6e0bc696 pkg/search: Add durationms to MediaTagConstraint comment.
Change-Id: I8c097c2c88afaf01b9eb0f62072f5e68bddf5ca0
2014-01-25 17:22:33 -08:00
Brad Fitzpatrick 92b23e391d search: basic lexer to supported quoted tokens in search expressions
Change-Id: I6c8c37e3b27ab947623bbe7431352a14aa029839
2014-01-25 11:04:02 -08:00
Daniel Erat 404548d31a pkg/index: Index more music-related properties.
Add disc and mediaref (a hash of the audio portion of the
file).

Also relocate taglib code to
third_party/github.com/hjfreyer/taglib-go.

Change-Id: I58364f525b787484af894663125163095256d7c6
2014-01-22 21:25:05 -08:00
Brad Fitzpatrick 5b03c3f8fb search, index: let media tags be searchable too.
git push from Dolores Park. Sorry, no tests. Dan Erat will tell me if
this doesn't work.

Change-Id: I557cc3d07983390b8a15b7756ee0825fced2f503
2014-01-20 15:47:36 -08:00
Brad Fitzpatrick 94ff6ac141 pkg/search, pkg/client, cmd/camtool: add 'camtool claims' subcommand
Change-Id: Id9d8381facd97a946c3582b226d433ab59b18da7
2014-01-14 11:48:49 -08:00
mpl 5a58142c2c search: title search
Add the title:foo operator to search, to search permanodes which have a
title containing foo, case insensitively.

http://camlistore.org/issue/329

Change-Id: I661df159a4057a889a7ed110b2e724fc6e43b32b
2014-01-10 17:35:30 -08:00
Daniel Erat 396c8a6211 search: Add ValueMatches{Int,Float} to PermanodeConstraint.
Adds constraints for int- and float-valued attributes.

Change-Id: Ie8354f8ea12f604b45cf2fa6a7fb45170bab7e46
2014-01-04 20:43:32 -08:00
Daniel Erat 0ea90ebec3 search: Add StringConstraint.CaseInsensitive.
Provides support for case-insensitive string comparisons.
The implementation needs work (e.g. substring searches do
potentially-large allocations).

Change-Id: I30f068094b4617b81aee2e8981f87f6ec2bc0000
2014-01-04 18:29:52 -08:00
Brad Fitzpatrick 2002359f73 Merge "search: Fix ZeroMax ValueNum permanode queries." 2014-01-05 00:07:55 +00:00
Daniel Erat 945073baf9 search: Fix ZeroMax ValueNum permanode queries.
Searching for permanodes with zero values for an attribute
returned no results due to a check that at least one value
matched. Only perform that check when a value constraint was
provided.

Change-Id: Ia25a595e4598fe682f2a85babca0b8438681a210
2014-01-04 16:05:54 -08:00
Bill Thiede 9aeb0aa2c7 pkg/client: Search fix zero-value Describe queries.
Adds support for zero value blob.Ref {Unm,M}arshalJSON.

Fix for:
https://camlistore.org/issue/308

Change-Id: I910fc4f05015b0c3ddc57eba9d1d8fe1bfe992bf
2014-01-04 08:11:23 -08:00
Brad Fitzpatrick a576379cb5 search: PermanodeConstraint.Time time constraint, 'before:' and 'after:' operators
Work in progress, but works enough to commit now.  Determing the time
of things has many TODOs, and there's some performance work to be done
(although it still appears to be instant... it just uses more CPU than
it should)

Change-Id: I4b04b5805353dfbde0b841a3a557fd0b7c297780
2013-12-31 18:31:02 -08:00
Brad Fitzpatrick dbe9b83cfa search: some refactor cleanup in prep for sorting work
Change-Id: I71d422774bb68a93c9f9d648de8e4e5bc2ef1d87
2013-12-30 21:03:29 -08:00
Brad Fitzpatrick 8a05c520f8 search: make sort type encode as a string in JSON
Change-Id: I50c5663e850f3e8710381cc59daf246c8a600482
2013-12-29 16:28:06 -08:00
Brad Fitzpatrick 7d4c86d0de client: add a Search method
Change-Id: Iec4c22bf6e4bbe40645ec178b5c2d23392ad270d
2013-12-27 16:22:06 -08:00
Bill Thiede 63096a3133 pkg/search: fix is:pano test.
Fix breakage in
https://camlistore.org/gw/7b6790f56ab3f634fb42908731b211ec2236b6cc

Change-Id: Iba1084944cec54c11702911a88c584ee0efe5fec
2013-12-24 21:25:28 -08:00
Brad Fitzpatrick 7b6790f56a search: make is:pano be a bit wider.
Change-Id: I73a27b296a62d77bd1f8967a690a361f7aa4edde
2013-12-24 17:55:46 -08:00
Brad Fitzpatrick bc15a1d7a6 search: fix two double-RLock deadlocks
Change-Id: I5d083150cb1dc4e43c6a64146dee8a3672b7ea40
2013-12-24 13:46:18 -08:00
Brad Fitzpatrick f8d9e6663d geocode: move logging
Change-Id: I42d901510f9d8085c29792fd6b7ea8e1dc082c06
2013-12-24 13:43:25 -08:00
Brad Fitzpatrick eb3407e3e1 search: add format:foo operator
Change-Id: Ia12dcc43bba019f7d6511cec36e4091c692113fb
2013-12-23 21:07:10 -08:00
Brad Fitzpatrick 04bed02906 search: add negative expressions and has:location
e.g. [is:image -has:location]

Change-Id: I03df0a1d5fea8394a33e3079d131224c116d4c0d
2013-12-23 20:39:06 -08:00
Brad Fitzpatrick 7238bd1652 search: GPS location search
Like loc:hawaii or loc:USA or loc:94128, etc.

Change-Id: I11f47bf464a812f0b62e7799752811144bb7454e
2013-12-23 19:11:55 -08:00
Brad Fitzpatrick 4a53f4d687 search: add width:[min]-[max] and height:[min]-[max] operators
Change-Id: I18a82d8f1d2ba519d78b234a240ff854f36a8c10
2013-12-22 19:26:49 -08:00
Brad Fitzpatrick 06a334c39f search: add is:portrait, is:landscape, and is:pano
Also support Width and Height constraints on raw search (not yet
exposed to the expression syntax, but will be like width:<640 or
height:100-200 probably)

Change-Id: I082e3d27b5ef5c238a8e65a6b836943d9f9ff8a6
2013-12-22 18:30:27 -08:00
Brad Fitzpatrick 82a356ab77 search: add FloatConstraint
Change-Id: Ic367e87cb239258a76a99c9d07f0956d67e242ea
2013-12-22 18:11:44 -08:00
Brad Fitzpatrick f27c12ee6a search: add is:image operator
Change-Id: Iba693538b4e7b3d0cf08d5e8601d3b5819000ca1
2013-12-22 15:11:31 -08:00
Dustin Sallings 84ff81d563 Test search describe with time travel
Change-Id: I6bd8dbfa64a27f4fa491655d52371487f6ea9bb5
2013-12-22 01:21:02 -08:00
Aaron Boodman e15052302b Implement the new "expression" support in the web ui
Change-Id: Ic0521f770ffd45c24505ff386b2c044dc307e284
2013-12-21 22:10:17 -08:00
Brad Fitzpatrick 130be113fd Merge "Include camliPath attributes as members from DescribedBlob.Members" 2013-12-22 01:38:45 +00:00
Brad Fitzpatrick 516751574e Merge "Support requesting claims as of a particular time" 2013-12-22 00:31:04 +00:00
Dustin Sallings f805ed2ba6 Support requesting claims as of a particular time
Change-Id: I44763bc7ffc59d08e577d7bbb74a00b3c798206d
2013-12-21 16:27:37 -08:00
Brad Fitzpatrick 79fb299ff6 search: server-side search expression eval + result set continuation tokens
Search expressions (e.g. "tag:funny location:Portland") can now be
evaluated server-side (expr.go and expr_test.go, still nascent). Next
step is to remove this parsing and construction from the javascript UI
code.

In addition, the search result now contains a continuation token to
continue interating through the result sets in a subsequent query.
The Javascript UI should use this now instead of parsing out
modification times of things and altering the search.  If there's no
continuation token, that either means the end has been reached, or
that search type doesn't [yet] support iteration. Currently only
permanode-based queries are supported at many layers, including
continuation, but will be implemented later.

For now, the web UI should send a search query "expression" value of
non-zero length but just whitespace (like a single space: " ") to get
the home page (recently-modified permanodes") because setting both to
the zero value is an input validation error.  We should probably make
an expression operator to be more clear here (like "want:permanode
sort:recent").  But the empty space hack works for now.

Change-Id: I3ea92eb8c776159f53c49db1a7439a91c507940a
2013-12-21 15:59:11 -08:00
Ulf Holm Nielsen daa4379bd3 Include camliPath attributes as members from DescribedBlob.Members
Change-Id: I30272acd1cae805cf9477f99611275d32231b52a
2013-12-18 13:53:00 +01:00
Brad Fitzpatrick 30c7d8859a thumbnails: add a cache-busting URL component, support ETag
And quiet noisy logging on normal write failures.

We can now stress test the thumbnail generation by setting
CAMLI_DISABLE_THUMB_CACHE=1 which will make all the thumbnails in the
browsers be unique, and not write them to cache on the server.

Then, when we're happy with the thumbnails, we just increment the
thumbnailVersion string and that busts all the browser- and
server-side caches.

Change-Id: I3cda8e85ab8b1b0b2c9113f6dff613dfbf736028
2013-12-16 20:27:49 -08:00
Brad Fitzpatrick a078ce9406 search: generate an optimized matcher and use it within the matching loop
benchmark                         old ns/op    new ns/op    delta
BenchmarkQueryRecentPermanodes        27987        27512   -1.70%

benchmark                        old allocs   new allocs    delta
BenchmarkQueryRecentPermanodes           99           87  -12.12%

benchmark                         old bytes    new bytes    delta
BenchmarkQueryRecentPermanodes         6433         6207   -3.51%

But will be better in practice with more blobs.

Change-Id: I4673702231c52864249329818145aad11da2b4fc
2013-12-14 12:07:35 +04:00
Brad Fitzpatrick d6691c16de search: add a basic query benchmark
Change-Id: I1da18ef34a5d1f83bb5be2f9684a64bc43312bd7
2013-12-14 12:06:10 +04:00
Brad Fitzpatrick b406cb3475 query_test: remove some comments, now that they're on RelationConstraint
Change-Id: Id38dcbb2cfce4ab15ec55c08005356fb2e018ee6
2013-12-14 10:33:15 +04:00
Brad Fitzpatrick 9af5a970de Mark boring files generated by FUSE as "hidden", then hide in the UI.
Makes for prettier FUSE demos w/ files showing up live in the browser
with websockets.

Change-Id: I41cc9ae0d33db39b4dbbf5b60714cee9a79b7248
2013-12-13 13:27:48 +04:00
Brad Fitzpatrick a0576f2c0d Fix corpus/search locking bugs.
The WebSockets live queries exposed a latent locking bug: the search
code was acquiring the Corpus read lock multiple times.  If a write
came in during the middle of a search, between two read locks, the
second RLock would hang (since a writer lock was pending) and then the
search and write would deadlock.

Instead, just acquire the read lock once at the beginning of the query and
never re-acquire it.  For now: new "Locked" versions of all the Corpus APIs.
In the future: will probably just add the locked-or-not into the context, and make
sure all Corpus methods require a *context.Context.

Also fix two potential data races: one with LogicalCondition (which
might've raced on the scratch ss buffer, depending on the query), and
a test-only race that didn't matter in production, but was annoying in
tsan output regardless, so fixed.

More tests to follow later. Unblocking Aaron for now.

Change-Id: Ie1edcbd061235f1ef04f9b4c68b86814c84361af
2013-12-12 11:34:07 +04:00
Brad Fitzpatrick 3da18bc2da typo: use Errorf instead of Error in test
Change-Id: Idaa1b8870975d50d22789ed6fd6787f213d0d0d3
2013-12-12 11:14:09 +04:00
Brad Fitzpatrick bbaf755995 search: WIP notes on RelationConstraint. Not implemented yet.
Change-Id: Ic179a046da146706b57d7e6e031e1665deedd036
2013-12-11 13:46:19 +04:00
Brad Fitzpatrick a833a2d376 search: validate queries
Change-Id: Icc2840852a878b1afdfb7be97ddd50008422f0f7
2013-12-09 12:10:43 +04:00
Brad Fitzpatrick 3ea697da55 Redefine Permanode attribute matching constraints.
Removes a bunch of TODOs about single- vs multi-valued attributes.

Change-Id: I512e4afb5e0f5508fbb390ead3ce5162f47c5d28
2013-12-09 11:27:21 +04:00
Aaron Boodman 933e16ebf1 Replace special-case 'recent' query in web ui with new search.
Realized there was a way more elegant way to implement infinite
scroll. Now it is general to any kind of query (though not yet
to any kind of sorting, as there isn't support for continuing with
arbitrary sorts server-side).

Change-Id: I98dc627e1292524ddd8af8960c134f49ac41f337
2013-12-07 23:34:27 -08:00
Brad Fitzpatrick ffc6c39d40 Live search results via WebSocket.
Works in the debug page now, but not wired up to the main UI.
Leaving that for Boodman.

Change-Id: I0d0acf78cbcd228e95e391d724ea43571d174511
2013-12-07 22:22:45 -08:00
Brad Fitzpatrick b2d221af44 Start of Camlistore WebSocket support, for showing live search queries in the UI.
If the JavaScript UI is open and the query you're looking at changes
due to new data arriving, the server should push the update search
results to you live, without needing to poll.

Change-Id: I00faf7737f9a459de39b21fb5226a8000feeee2b
2013-12-07 20:19:20 -08:00
Brad Fitzpatrick b020f60390 search: add test for earlier fix in commit 1e1183a8bf
Change-Id: I95c0f885079de17cd1c52b9ad40861c96eb5308c
2013-12-07 10:53:30 -08:00
Brad Fitzpatrick 1e1183a8bf search: add a forgotten Cancel.
Funny, because this one line is why I finally went and added the Context type
and started plumbing it through lots of stuff.

Change-Id: Ie419362048a485629e79725de9297fe485430d4a
2013-12-07 08:49:30 -08:00
Aaron Boodman d593b6f98a LogicalConstraint: typo in comment
Change-Id: I62345763e42832e2575f492a9678dbb0cfb65ec6
2013-12-07 07:11:16 -08:00
Brad Fitzpatrick cad54aa249 search: fix a panic in Query w/ describe, add tests
Change-Id: I4a2288298fbab8a51c795b9eaed5fc3488024132
2013-12-03 18:24:02 -08:00
Brad Fitzpatrick a7c7e717f6 search: optionally also describe matched blobs in same request
Change-Id: Id9c16c19fa309d0780c6107b1dd29880d777fd05
2013-12-02 20:29:50 -08:00
Brad Fitzpatrick bf4d2721ba search: efficient permanode queries, sorted, and with a limit.
Change-Id: I7f8edfe3636ff3f1344ebb41e27d23073c630ff5
2013-12-02 20:01:37 -08:00
Brad Fitzpatrick 4eaeee9ae3 Reduce in-memory size of image info dimensions.
For my personal server,

Before:
Corpus stats: 149.884 MiB mem: 787886 blobs (88.853 GiB) (279308 schema (6073 permanode, 150557 file (111819 image), ...)

After:
Corpus stats: 145.172 MiB mem: 787886 blobs (88.853 GiB) (279308 schema (6073 permanode, 150557 file (111819 image), ...)

Change-Id: I47484e46b1eb70c8c4b5ee356cdcb0ceecde94e7
2013-11-29 11:01:41 -08:00
mpl 1ee5fd20c5 search: deletions are not modifications
1) pkg/search: documented that deletions times do not
qualify as modtimes

2) pkg/index: got rid of DeletedAt, and keyDeletes

http://camlistore.org/issue/191

Change-Id: I39578913345454d36af4599e29e7053f46577846
2013-11-29 00:29:57 +01:00
Brad Fitzpatrick 1ec41b95f0 Speed up in-memory permanode attribute search.
Finishes Corpus.AppendPermanodeAttrValues and uses it in
PermanodeConstraint.

Change-Id: I031789e0974add24886cc0060e52ba538535c4e1
2013-11-27 12:47:04 -08:00
Brad Fitzpatrick 9a749ce73b search: efficient in-memory scans of permanode modtimes
Change-Id: I82d34544a86cd9f3a52c2b7140dd89eac32fbfa9
2013-11-26 19:47:00 -08:00
Brad Fitzpatrick 1455a14e72 search: some refactoring to ease future work speeding PermanodeConstraint queries
Change-Id: Iac98a632bd40c723481f8e635a2c34780e87a408
2013-11-26 19:05:43 -08:00
Brad Fitzpatrick a918fac281 search: let GetRecentPermanodes take a before param.
For infinite scroll.  Will be done better later, but this works for now.

Change-Id: I88dc7793b643226a4a5e3a583c5de5d4c7fa4819
2013-11-25 20:35:59 -08:00
Brad Fitzpatrick 9aaadc73b8 index: put ImageInfo in memory too
Change-Id: I8110df05dd14ec3ede2e49902b172ed9bf069bfb
2013-11-25 19:46:28 -08:00
Brad Fitzpatrick 2fb3d06d49 Remove dependency on the testing package from pkg/index. Polluted flags.
Change-Id: Id5492fcab022c03e40501830d9253b5605a14ee6
2013-11-24 17:45:45 -08:00
Aaron Boodman 650bd9b61e Display a folder icon and make camliPath attributes navigable.
Like we do for camliMember.

Change-Id: I2db51d7397e0f8ab86ea71716fe06099ba22005a
2013-11-22 22:49:07 -08:00
Brad Fitzpatrick c5037b76e6 Fix thumbnails, broken in cb31dd58d2
Change-Id: I82defd54f53d4f6c1a594185d5e9b7d3a4a92c07
2013-11-20 17:44:10 -08:00
Brad Fitzpatrick 531b4dc32b search: remove MIME from DescribedBlob; fix Handler tests.
Change-Id: I2d92155e3446325520d91379ac24becef49ca56f
2013-11-18 16:36:08 -08:00
Brad Fitzpatrick 48dba353e9 query: make all tests test in all three modes.
Change-Id: I945830ddb3bfe68a7223994b94d780b46503c95e
2013-11-17 20:20:27 -08:00
Brad Fitzpatrick cb31dd58d2 In-memory search: include FileInfo. More tests pass.
Change-Id: Ic33357b63d1d57dc174fe18360e920730016c903
2013-11-17 19:49:19 -08:00
Brad Fitzpatrick e8603b1293 Put claims in memory too for in-memory search. Required index schema version bump.
Change-Id: I194d65476bddea111277cd0b1472c56b5527226b
2013-11-17 16:52:51 -08:00
Brad Fitzpatrick 0b07171c0c index: change GetOwnerClaims interface for efficiency, rename to AppendClaims
Change-Id: Icec235961ed8a09256df87c5fe1455cbad81ae3f
2013-11-17 14:54:30 -08:00
Brad Fitzpatrick d82f02db50 Search optimization: keep blobs arranged by camliType in memory; use when possible.
Change-Id: I8b3ebcf7dfece21d17074da32dc20e4d600e4c50
2013-11-17 10:52:37 -08:00
Brad Fitzpatrick 3eb493599e in-memory search: better structure for keeping memory corpus and kv
index in sync, both at start-up and while running and receiving blobs.
They both use the same mechanism now.

Also adds KeyId to the index and Corpus, as the next step. Plenty more
row types remain...

Change-Id: Id79955ba25dc79d5fbd94b0e5248d33dcf71d97e
2013-11-17 09:41:45 -08:00
Brad Fitzpatrick 272db6545a index: change GetBlobMIMEType to GetBlobMeta. mime types on a blob was wrong anyway.
And some more of in-memory search, which this makes easier / less garbage-y.

Change-Id: If1fa7dd44842244ae5e5440f84e92d66dc3321fb
2013-11-16 19:40:14 -08:00
Brad Fitzpatrick f3cc3c7ed9 search: more in-memory search work. make tests verify Scan doesn't hit Storage.
also some string interning work.

Change-Id: I7864b56eb97318bce943afdca3b1212f4729a9a8
2013-11-16 18:50:01 -08:00
Brad Fitzpatrick e26eacfa2f index: return FileInfo and ImageInfo as values, not pointers.
Change-Id: I6aba3a74ce233cc834550b561f597e549fb2bfab
2013-11-16 17:49:28 -08:00
Brad Fitzpatrick 2984897ac7 search: more in-memory search work.
keep blob metadata in memory, and start of testing all search queries in three modes:
classic index.Storage scanning, all in-memory with corpus scanned from the index.Storage,
and the in-memory corpus built up over time as blobs arrive.

Change-Id: I40536e498a63bece5bd4897cdbbd0cef78085f44
2013-11-16 17:24:02 -08:00
Brad Fitzpatrick c573feb226 Make the search handler conditionally request the index be slurped into memory.
Change-Id: I7fadeba41c3b1bbcfbb0fd3470ff30cdf04b1b90
2013-11-16 15:18:16 -08:00
Brad Fitzpatrick 705107ad80 search/index: invert depedency. search now depends on index.
creates new package types/camtypes for misc types needed by both. might eventually go away as
search matures.

Change-Id: Ib771ead7bea39936ba478b7e5d58de997060861b
2013-11-16 15:00:30 -08:00
Brad Fitzpatrick 25eca52283 Merge "pkg/search: add modtime in WANT to fix tests" 2013-11-16 22:26:28 +00:00
Brad Fitzpatrick 7f8e035be6 search: little TODO
Change-Id: I38a98c9c9b77a899536cf0d7601ce2030d6f4dda
2013-11-16 12:54:11 -08:00
Brad Fitzpatrick 8a5161ec30 search: multiple constraints at top level
Change-Id: I964a0d394c3c03e2409c91fb1d240847ff07ddb3
2013-11-16 11:21:30 -08:00
Brad Fitzpatrick 17a9d061a0 search: ditch BlobSizeConstraint, use IntConstraint instead
Change-Id: I99bece643841feab777175479743b3bd1fc421b8
2013-11-16 11:10:09 -08:00
Brad Fitzpatrick 1e627ce7c3 search: change BlobMeta to have a CamliType, not a misleading MIMEType.
Change-Id: I1c6e111ef27aafd5a15f9b38746361093a78e9e6
2013-11-16 10:35:18 -08:00
mpl 01a8dbb163 pkg/search: add modtime in WANT to fix tests
Also fixed fakeindex clock to use a time.Time.
And synchronized the fakeindex and the indextests clocks to the
same origin.

Change-Id: I986abca300d61241069132619028f470cacd61da
2013-11-15 23:31:24 +01:00
Brad Fitzpatrick 9587b8e62e search: rename AttributeConstraint to PermanodeConstraint, add ModTime constraint 2013-11-14 15:31:44 -08:00
Brad Fitzpatrick e0c3cf9b01 search: optimize ClaimList.Less sort. duh. 2013-11-14 15:30:59 -08:00
Brad Fitzpatrick 6e7df1c6ee search: IntConstraint 2013-11-14 15:30:40 -08:00
Brad Fitzpatrick f718e64289 search: start of DirConstraint. mostly notes. not implementation.
Change-Id: I6403b4f9be2aa06778fb1ef96edde2896557c3c9
2013-11-09 18:56:52 -05:00
Brad Fitzpatrick 33b11f86b9 search: skip TestHandler in short mode
Change-Id: I6f0c651cf7bf4324c9c4d785400588c2ff08557e
2013-11-09 17:24:35 -05:00
Brad Fitzpatrick c9443d7c7b search: TimeConstraint
Change-Id: Ic50290109043c1ad906f25935e5fad4c2170ea77
2013-11-09 17:08:46 -05:00
Brad Fitzpatrick 4c70e14310 search: add LimitReader around JSON decoding. add some TODOs
Change-Id: I98069ef0aeb8c96cdc997c138222e0344981ead8
2013-11-08 14:49:23 -05:00
Brad Fitzpatrick 4d620d2c60 Merge.
Change-Id: I15452c93c287eacf42e50dac59549a23d5e219c2
2013-11-08 14:47:51 -05:00
Brad Fitzpatrick c477ef43bb search: FileConstraint, StringConstraint, start of TimeConstraint, EXIFConstraint
Change-Id: I8464a392f2671e75898b64295b0c2e2261292ff9
2013-11-08 14:46:00 -05:00
Hunter Freyer 3fb2a0be4f Adds server-side search query handler.
Change-Id: Id1bdaa0f5f5a208ccf41ce25e5c50970f66f9469
2013-11-08 13:39:20 -05:00
Brad Fitzpatrick 59f20db9b2 search: delete unimplemented and now-undesired BlobTypeConstraint
The CamliType and AnyCamliType are better.

Change-Id: I0fbe9e645fa0ca13d107f7012bcb0008dfd5d43d
2013-11-08 13:17:37 -05:00
Brad Fitzpatrick 948bc3ba48 search: query support for AttributeConstraint.ValueMatches (subqueries)
e.g. show me permanodes with a camliContent pointing to a jpeg over 2.5 MB

Change-Id: I8b9c5c4b3595b64538281f63db7852461fd0367c
2013-11-08 13:11:16 -05:00
Brad Fitzpatrick 9e1948be25 search: ValueSet
Change-Id: Ie8b1b2c24ab9dcefb4f5e5d2db885568646ca228
2013-11-08 11:35:21 -05:00
Brad Fitzpatrick 13a732c46b search: query permanode attributes (a start)
Change-Id: I1e6109df0d09edf894a32934eec5be7b6ad9fc1c
2013-11-08 11:25:51 -05:00
Brad Fitzpatrick 5e2a4d8e9a search: add Handler.Describe, make serveDescribe HTTP handler use it
Change-Id: I6f5a45b066aa02ad40cc7fdd2067ac6c178a62ab
2013-10-25 00:23:10 -07:00
Brad Fitzpatrick abdfd02bbb search: add camliImportRoot to set of indexed properties
Change-Id: I63a16e704569b2c834cda7cc9c84ce14bb31511d
2013-10-24 22:49:31 -07:00
Brad Fitzpatrick a78704c979 search: add AnyCamliType constraint
Change-Id: Ib129d4d365d040e0b12b2e3aa35c38a59ed7bc04
2013-10-18 19:10:59 -07:00
Brad Fitzpatrick ea079282d6 search: tests for logical operators
Change-Id: I3d389c3b58206fd98140834162aec17218bbce14
2013-10-18 18:50:19 -07:00
Brad Fitzpatrick f515ec9861 search: add test for blob prefix queries
Change-Id: If53acf332f8eb72d82735d8707a77a21694e83ba
2013-10-18 18:28:05 -07:00
Brad Fitzpatrick b9d4b7dc09 search: search on blob size
Change-Id: Id87fb65ebe0fec304637c6acb29ea27bd99d3bb1
2013-10-18 18:12:23 -07:00
Brad Fitzpatrick 7101fe1b64 search: search on CamliType
Change-Id: Ie4c0655da9407b49a67cd6d11240b697bd9bd6f0
2013-10-18 17:56:56 -07:00
Brad Fitzpatrick 17ecf8df07 search: start of general Query support. very rough draft.
Start of something that builds and 'works', but barely fleshed out at all.
Likely to change drastically yet.

Change-Id: I7fba25528a341ff2dbbc4dbb579f2450d7889320
2013-10-18 17:17:35 -07:00
Brad Fitzpatrick 7742892670 Merge branch 'master' of https://camlistore.googlesource.com/camlistore 2013-10-05 20:46:43 -10:00
Brad Fitzpatrick c8badb4404 Misc cleanups
Change-Id: I9183ca1ec7a98df210373f27ec3493c996f00f74
2013-10-05 20:46:39 -10:00
Aaron Boodman 74eb8e6c3c Further visual refinements to layout of homepage:
* Increase default image size a few settings
* Increase gutter between items
* Remove extraneous padding and whitepsace
* Remove unneeded gigantic heading
* Move build version into statusbar
* Change algorithm for fitting rows -- instead of preferring to clip
  edges of image, instead prefer to adjust height of rows. I find it
  looks more interesting visually when the widths of the images vary
  more.
* Replace folder and file icon with something better looking
* Swap order of + and - buttons in toolbar, they were backward from
  what is typical

Change-Id: Idfe85a813926c2c9eea774a86046df62ecacd45c
2013-10-04 14:04:38 -07:00
mpl 304f5c4b38 camput attr: support -del
Change-Id: I28460fed5b572ba9a83cfcb04f38e42124fa723f
2013-10-03 15:07:43 +02:00
Brad Fitzpatrick 128f56887b Handle GET and HEAD the same in more (all?) places.
Change-Id: I486a95f0a6fc127d17dcf0abeb94eab292980156
2013-09-15 20:12:26 +01:00
Brad Fitzpatrick 0375ee2d47 Do directory describe queries in parallel.
Change-Id: I9e3a4d97a97b177356d11d4ff0a735d80bfc63db
TODO: use syncutil.Group in many more places.
2013-09-12 16:22:00 +01:00
mpl d488c576fc search: support for static directory children
This change introduces a new index entry
to help with finding the children of a static directory.
It also fixes ResolvePrefixHop so that it takes
into account static directories, and not only collections.

This is the first step to support publishing static directories.

http://camlistore.org/issue/179

Change-Id: I5666e5caa6c782004054ae4c19a6b6119d4fda8b
2013-09-10 23:06:48 +02:00
Brad Fitzpatrick 3a5793b743 search: actually use result of SearchPermanodesWithAttr and don't leak a goroutine
Change-Id: Ia1ff8acc1d396901c6b589dbe9a972e3dd4df05f
2013-09-03 18:22:05 -07:00
Brad Fitzpatrick 0bdf20884b all: delete pkg/blobref; convert all from *blobref.BlobRef to new blob.Ref
Change-Id: Id2dfb7f19452bedf4f3c9310b36227fd8117b225
2013-08-03 19:54:30 -07:00
Aaron Boodman 24458fca93 Tile images nicely within BlobItemContainer.
Screenshots here: http://imgur.com/XN9qFLP,PeEDPnW,CS35Pw6,VS0nHaG,SNT1ZXZ,2nMWVYz,8RmuLuw,NE8b26n,EFErMdg

Change-Id: I6a66b5b782363882261b80e7ac9930ff1046efa6
2013-08-01 22:25:52 -07:00
Brad Fitzpatrick c28fcb4cda search: let the HTTP interface describe multiple blobs at once
Change-Id: I1998e0fa9a550fb15589bde6da1b549c14bcb97c
2013-07-11 20:17:05 +10:00
Brad Fitzpatrick 4a404a3c60 search: clean up describe handler and DescribeRequest
Change-Id: I4e6184765b6139de3bdc153d27a12d3cb205a55e
2013-07-11 10:35:06 +10:00
Brad Fitzpatrick d2b8d08397 search: make describe follow camliPath attributes
Change-Id: I875587a734d118a3f3fc204901ae1788247b91ab
2013-07-11 10:03:56 +10:00
Andrew Gerrand 64153d9f02 client,search: add withattr and describe to client
Change-Id: I9d55a7283bc7c99560e61aea80024c8f80dacc05
2013-07-10 21:10:18 +10:00
mpl 574b5feb96 Merge "publish: serve a zip of all files in a published path" 2013-07-08 13:32:01 +00:00
mpl 86b591cab9 publish: serve a zip of all files in a published path
Change-Id: I415f4d50936ab419695389dcda1facaf71565a8d
2013-07-08 13:00:41 +02:00
Brad Fitzpatrick 9468e5ba70 More docs. Every package is documented now.
misc.CountingReader moves into readerutil.

pkg/atomics is folded into pkg/types.

pkg/test/testdep is folded into pkg/test, with better name/docs.

Old cruft from pkg/webserver is deleted.

Change-Id: I3f72d8b29804254ef944995fb085837c878f79f5
2013-07-07 21:12:30 -07:00
Brad Fitzpatrick d832b6a06f Document PrefixHandler and clean up users with accessor functions.
Change-Id: Ib0b23ff3cc548a35c35eae1cdc59a8673dc19638
2013-06-12 11:17:30 +02:00
mpl af204bca92 newui: search page, with index page style
Change-Id: Iad9a3e914a4ffa79af6629c88a13a9946b7f3a2c
2013-05-19 00:38:19 +02:00
Brad Fitzpatrick 85c0fa9c61 Merge "search: factorize max results sanitation, allow max specified from ui" 2013-05-01 02:22:24 +00:00
mpl e9443ec182 search: refactor serveEdgesTo with annotated structs
http://camlistore.org/issue/99

Change-Id: I84ed551db4fecbd1ca06d76759d7512d1651bbf2
2013-04-26 18:33:27 +02:00
mpl 7c08f37abe search: factorize max results sanitation, allow max specified from ui
Change-Id: I066369829816189dbd2f682ce003c8b82022d131
2013-04-04 15:38:55 +02:00
mpl 0dfd84a7d8 search handler: return correct thumbnail dimensions
images: DecodeConfig to get the predicted width
and height after EXIF correction
search&index: add GetImageInfo and use it in search
to predict the thumbnail dimensions

http://camlistore.org/issue/115

Change-Id: I358136a2ab03ea09c8f8fd2fa0dc574921c819c5
2013-03-25 17:06:15 +01:00
mpl 5344af8e39 search handler: more tests, and fix for the describe depth race
http://camlistore.org/issue/121

Change-Id: I5807df784d9bd47f3cc8720a891d458ee722013b
2013-03-06 19:04:10 +01:00
Brad Fitzpatrick ace9474d95 index: index file times too, and return in index.GetFileInfo.
Change-Id: I59d91f0938c725a4cbdf5ca933cdff3529e25f5f
2013-02-18 21:31:41 -08:00
Brad Fitzpatrick 8155b3867a Fix case of MimeType to MIMEType, per Go style.
Change-Id: I6c67a61cea2c71d7fa5d52c4ae283e33e993fd0f
2013-02-18 11:16:13 -08:00
mpl 1b06e32f30 search handler: formalize and split serveSignerPaths
Change-Id: I8399b55aed45d3456b0cad89a4cf5bb6f4c57d69
2013-02-13 17:51:39 +01:00
mpl 46846e0844 search handler: getClaims: error out if nil permanode
Change-Id: Ieeb36ec3c3ed0c9f68abc6a659ba8f0b23a5bbb1
2013-02-12 16:46:16 +01:00
mpl 1f2b140bbd search handler: formalized and split serveClaims
Plus a few related cleanups (better httputil use).

Change-Id: I9ea34f2fe658624d05b7a6f347f5d946759a07b5
2013-02-12 01:18:46 +01:00
Brad Fitzpatrick f1845db855 search: split metaMap into metaMap and metaMapThumbs
Change-Id: I5a29166be7ed44a7c6a954ba689f1f3dbfbe57d7
2013-02-10 12:59:05 -08:00
Brad Fitzpatrick 7300184066 httputil, search: more HTTP util usage, deleting code.
Change-Id: I90e51a3e8b3fdd868b26a40446f9715aaa7f89c0
2013-02-08 22:21:09 -08:00
Brad Fitzpatrick e624e24c46 httputil/handler: start of more formal approach to input validation and HTTP error handling
Change-Id: I219a6263e1ba2d0e64819c01a885078dbf1c8b4c
2013-02-08 19:04:24 -08:00
Brad Fitzpatrick 3605285924 Add pkg/types with types.Time3339; use it in search/handler JSON types
Change-Id: I79bf1484ef8b3548bca2e732f189352bcfbcd6db
2013-02-08 18:10:31 -08:00
mpl 0a84607099 search handler: all funcs now rid of manual maps responses.
serveDescribe, servePermanodesWithAttr, and serveSignerPaths
rewritten like serveRecent. Got rid of populateJSON.

http://code.google.com/p/camlistore/issues/detail?id=101

Change-Id: Id730d40005476634b138b13260248e497d1a87d0
2013-02-09 02:12:06 +01:00
Brad Fitzpatrick 76735113f9 fs: recent directory works.
Change-Id: I13fb418e7ef32c8be8ab635b8179fbded5e18c79
2013-02-07 22:43:50 -08:00
Brad Fitzpatrick e867ea7dc0 client, search, fs: cammount now getting search queries back
Change-Id: I68541e9f9d54fa4240872d440972ad39f6bad33f
2013-02-07 21:55:17 -08:00
Brad Fitzpatrick a068e4d7aa search: separate out query logic from HTTP/JSON on GetRecentPermanodes
Change-Id: I4afb34aa548e83a2db2374a4cca2a9d5368473be
2013-02-07 21:34:25 -08:00
Brad Fitzpatrick f8639c5c5c search: fix error message
Change-Id: Ic89e3a32a919414746eeb1c96f3b694fabf9798a
2013-02-07 19:20:37 -08:00
Brad Fitzpatrick cfa43225d4 search: move thumbnailSize out into a func
Change-Id: If7d6ab242fe7fcef2174aa9dad12a85a06ce0091
2013-02-07 09:40:59 -08:00
Brad Fitzpatrick 6cc5f33da1 search: handler response type cleanup (Issue 99).
Notably, don't mix 'meta' bag keys with rest of response. Makes it easier for both Go and Closure types to not mix keys from one type with another type.

Change-Id: I65e51f2a6c236c5111b5a9b88830e1220d6b29d4
2013-02-07 09:33:00 -08:00
Brad Fitzpatrick c34fc8c345 search: use a struct for recent items, not manual map
Change-Id: I443983b3689434afc0471a55357a78d03c0bb18f
2013-02-07 08:05:31 -08:00
Brad Fitzpatrick 5a8afdf951 search: rename populateJSONThumbnails to populateJSONAndThumbnails
Change-Id: Ibd4db3909c01c8a352df1875de703c71d657c428
2013-02-07 07:54:45 -08:00
Brad Fitzpatrick 6e35c1c26e search: don't fail the whole search request if dir info isn't available
Change-Id: Iae78d099c608dbe41f8ce9ccad1a11d70d212c48
2013-01-20 11:12:32 -08:00
mpl 67c5678062 Index directories with "fileinfo", and use this to
find their name in a search request.

Fixes http://code.google.com/p/camlistore/issues/detail?id=79

Change-Id: I755afd8f52dbd2f8a48ba72bed0a6b0192d1dd71
2013-01-09 16:59:04 +01:00
Brad Fitzpatrick 31df4a7a01 Add generic file icon.
Change-Id: I23517e6112ddfd7048a575161a7785b73fb7bd0f
2012-12-06 17:36:34 -08:00
mpl d1e5a1d4c6 search UI: find all roots
This change allows to find all roots (permanodes with the
"camliRoot" attribute) from the search.html ui page.
To achieve that, func (x *Index) SearchPermanodesWithAttr
now uses a prefix string without the query part if the
query is "".

http://code.google.com/p/camlistore/issues/detail?id=35

Change-Id: I396fba683e6e7b2296d1f0df8009c07e3c2cd09d
2012-11-14 11:11:40 +01:00
mpl ffcbad9528 fix search handler test:
leading slash for thumbnailSrc removed

Change-Id: If402235986d12bfbba11bbaf4f82d5cb051ec226
2012-11-12 23:20:24 +01:00
mpl def34eff94 display thumbnail on the permanode page if content is image.
The serveDescribe search handler now also checks for the
thumbnails req parameter and uses populateJSONThumbnails.
As a result, the client side can directly use thumbnailSrc
from the json response.

http://code.google.com/p/camlistore/issues/detail?id=62

Change-Id: I4ff606f8d3ef291490f05cabdc66219744b53638
2012-11-10 00:04:44 +01:00
mpl 438ae4ecb4 recent permanodes thumbnails
Change-Id: I140766df4b58853e5bc4358f564cf1cfc807882a
2012-11-09 19:43:18 +01:00
Brad Fitzpatrick ef47a3533e index: fix deadlock, document PeerBlob and friends' lock rules, rename lk to mu 2012-11-09 10:00:47 -08:00
Brad Fitzpatrick a41269e78e Reindex all dev-server blobs into memindex on restart.
Required some sync work (full syncs on start, blocking full syncs on
start, and also adding a dev-only hack to force a depedency from
search -> sync, to control the handler initialization order, otherwise
publish handlers would race with the sync handler and they'd create
new "blog" and "pics" permanodes and we'd end up with duplicates).
2012-11-07 22:40:17 +01:00
Brad Fitzpatrick e582f155ed Thumbnails for permanodes with members (folder) and camliContent to file images 2012-11-05 18:01:03 +01:00
Brad Fitzpatrick 6f82d343ef search: push thumbnail logic into its own function 2012-11-05 17:23:42 +01:00
Brad Fitzpatrick 9b7faaca07 Push server-side thumbnails down into DescribeRequest. Use node.png. 2012-11-05 16:32:56 +01:00
Brad Fitzpatrick 03b8cd143f Start of server-side icon support for recent permanodes list. 2012-11-05 15:48:13 +01:00
Brad Fitzpatrick 832b774025 search: add EdgesTo handler and tests 2012-11-05 15:09:34 +01:00
Brad Fitzpatrick f696007a14 index: implement EdgesTo
For finding back references in the graph.
2012-11-05 10:29:42 +01:00
Brad Fitzpatrick e783ad1717 Add another search handler test, for recent permanodes.
Change-Id: Iaf40cd94aba7b96c16fa1b04c2bfcebdfeea870e
2012-11-04 15:26:13 +01:00
Brad Fitzpatrick 305b4557b9 Improve search handler tests.
Change-Id: I5639447cc95f06d0773e7f15cb601d51c7dd5031
2012-11-04 13:59:19 +01:00
Brad Fitzpatrick 4b0d2841ee Add search.EdgesTo method to search interface. No implementation yet.
Change-Id: Ie3a9eb91e218e172b195d55cb9c17cb6c8f819ce
2012-11-03 16:08:37 +01:00
Brad Fitzpatrick 1466c77198 Add 'edgeback' key to index, for going backwards.
Change-Id: I43057a6fb96c3e8d9364002288d5c7b9ad2fd034
2012-11-03 14:25:48 +01:00
mpl 3e9aef409c search handler: documented the "attr" values when searching for a permanode
Change-Id: I607d1fe016078912faac9864630552cd2b496aa2
2012-10-24 17:26:46 +02:00
Brad Fitzpatrick 8c293e34b6 Per Go initialism style, rename Json to JSON 2012-07-28 15:42:56 -07:00
Brad Fitzpatrick 3b30cbd63f add TODO
Change-Id: Icd386f58b9004b78dd52bdaf32cca257d1593495
2012-05-13 13:30:42 -07:00
Brad Fitzpatrick 1b63c44b4e Update all os.ENOENT references to ErrNotExist. Mostly docs/dead code.
Change-Id: I2bb4d5a9d9c610e8dce2309335d06046dbb1e049
2012-05-13 12:06:21 -07:00
Brad Fitzpatrick 997f0db09e fix pkg/server tests
Change-Id: I2b34e61a128c15f20392b325a532b113a457f488
2012-03-29 16:22:05 -07:00
Brad Fitzpatrick 0714a463c9 Update from r60 to [almost] Go 1.
A lot is still broken, but most stuff at least compiles now.

The directory tree has been rearranged now too.  Go libraries are now
under "pkg".  Fully qualified, they are e.g. "camlistore.org/pkg/jsonsign".

The go tool cannot yet fetch from arbitrary domains, but discussion is
happening now on which mechanism to use to allow that.

For now, put the camlistore root under $GOPATH/src.  Typically $GOPATH
is $HOME, so Camlistore should be at $HOME/src/camlistore.org.

Then you can:

$ go build ./server/camlistored

... etc

The build.pl script is currently disabled.  It'll be resurrected at
some point, but with a very different role (helping create a fake
GOPATH and running the go build command, if things are installed at
the wrong place, and/or running fileembed generators).

Many things are certainly broken.

Many things are disabled.  (MySQL, all indexing, etc).

Many things need to be moved into
camlistore.org/third_party/{code.google.com,github.com} and updated
from their r60 to Go 1 versions, where applicable.

The GoMySQL stuff should be updated to use database/sql and the ziutek
library implementing database/sql/driver.

Help wanted.

Change-Id: If71217dc5c8f0e70dbe46e9504ca5131c6eeacde
2012-02-18 21:53:06 -08:00