breck7 / pldb

PLDB: a Programming Language DataBase
https://pldb.io
729 stars 99 forks source link

Search 2.0 Bug Bash #406

Closed breck7 closed 1 year ago

breck7 commented 1 year ago

v1 of Tree Query Language is live! https://build.pldb.com/search

Example queries:

"All languages created in the 90's in Italy":

https://build.pldb.com/search?q=select+country+appeared+type%0D%0Awhere+country+includes+Italy%0D%0Awhere+appeared+%3C+2000%0D%0Awhere+appeared+%3E+1989

Please bug bash and submit broken queries here.

breck7 commented 1 year ago

Broken: https://build.pldb.com/search?q=where+

Update: FIXED

breck7 commented 1 year ago

Broken: https://build.pldb.com/search?q=select+creators+appeared%0D%0Awhere+supersetOf+json

Update: FIXED

breck7 commented 1 year ago

The results here should not be blank: https://build.pldb.com/search?q=select+creators+appeared%0D%0Awhere+supersetOf+includes+json

Update: FIXED

breck7 commented 1 year ago

Need to add the "export as CSV" url

Update: FIXED. (Not exposed in the UI, but that's fine for now. An advanced feature:)

https://build.pldb.com/search?q=select+creators+appeared%0D%0Awhere+supersetOf+includes+json&format=csv

breck7 commented 1 year ago

Can we autocomplete permalink ids?

Update: DONE.

breck7 commented 1 year ago

Features should probably be flattened so they are better searchable.

Update: FIXED.

I did not flatten them yet but added support for searching deep columns using dot paths:

https://build.pldb.com/search?q=select+type+appeared+githubRepo.stars%0D%0Awhere+features.hasSemanticIndentation+%3D+true%0D%0AsortBy+appeared%0D%0Areverse

breck7 commented 1 year ago

Permalinks/filenames should probably be switched to camelcase? (Though that might be bad for case insensitive filesystems)

https://github.com/breck7/truebase/issues/21

breck7 commented 1 year ago

Should links be clickable in columns automatically? Could be done at the scroll level.

breck7 commented 1 year ago

When there are zero matches it says "undefined"

Edit: FIXED (I think, can't repro anymore)

breck7 commented 1 year ago

Add sortBy

UPDATE: Fixed.

https://build.pldb.com/search?q=select+appeared+creators%0D%0Awhere+creators+includes+Niklaus+Wirth%0D%0AsortBy+appeared%0D%0Areverse

breck7 commented 1 year ago

Add "or" conditions?

celtic-coder commented 1 year ago

Add sortBy

Yes, the first feature that I checked! 😊

breck7 commented 1 year ago

Thanks @celtic-coder ! That helped me prioritize what to fix next.

I added sortBy and reverse:

https://build.pldb.com/search?q=select+appeared+creators%0D%0Awhere+creators+includes+Niklaus+Wirth%0D%0AsortBy+appeared%0D%0Areverse

ghost commented 1 year ago

@breck7 : You had earlier mentioned about autocompleting permalinks ID's

Is lists in pldb just select query with ordering/filtering primitives like sortby/missing ?

or it is just select query and its result, if so a link the lists view page, where missing fields or others could be looked at easily would be helpful.

breck7 commented 1 year ago

Hey @SRS-WRKS you can easily look up all the entities with a missing entity using the new missing keyword:

Missing type (0): https://pldb.com/search?q=missing+type

Missing appeared (96): https://pldb.com/search?q=missing+appeared

Missing country (1,526): https://pldb.com/search?q=missing+country

Missing creators (3,585): https://pldb.com/search?q=missing+creators

You can also do AND queries.

Missing appeared but NOT missing creators: https://pldb.com/search?q=missing+appeared%0D%0AnotMissing+creators%0D%0Aselect+creators

celtic-coder commented 1 year ago

Missing appeared but NOT missing creators: https://pldb.com/search?q=missing+appeared%0D%0AnotMissing+creators%0D%0Aselect+creators

It would appear that select always selects the Title column, regardless of anything else in the select statement. Is this the default? Can it be changed?

Missing creators (3,585): https://pldb.com/search?q=missing+creators

Again, without even a select statement, the Title field is returned. It makes sense to have this as a default, but again, can this be changed?

breck7 commented 1 year ago

Great question @celtic-coder ! Yes I was thinking about this yesterday. This is currently "magic" behavior that I started with to help in the beginning but now I agree it needs to go. I made a note of it: https://github.com/breck7/jtree/blob/55789a71f73d3c3bc2a4b2c5d856a2a436abd1c0/treeBase/TreeBaseServer.ts#L196

ghost commented 1 year ago

@breck7 :
Building ontop of @celtic-coder 's suggestion only the title field seems to link to a pldb entry, can i change which field is allowed to link to to pldb entry ?

If i want to select type from pldb entry and make the type field link to the pldb programming entry's page ?

breck7 commented 1 year ago

Thanks everyone! I moved out the remaining issues into their own issues.