Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
rococtz
@rococtz:matrix.org
[m]
@ruslanjan: You have to manually create a text index. In MongoDB or SQL, this is done automatically for you (if you specify you want it indexed), but in Gun you create the index yourself:
gun.get('thatIndex').get(item.name).put(refToItem);
and then you use the LEX queries
Ruslan Jankurazov
@ruslanjan
So i just do this ‘gun.get(index).put({text: dataRef})’. I will try
@rococtz:matrix.org
Mark Nadal
@amark
@cryptoboid :wave: hiiii! :) :clap: @mundane_pftts:matrix.org ! Did that work?
@achilldotes_twitter only a server can generate emails so you'd need a backend :( :( :( tho in past we've talked about adding an email gateway to the relays that has a rate limited notification API, would you be interested in helping build this? I'll screencall and show you the code & algorithm to start. Elsewise on page load just check localStorage for account else generate await SEA.pair() to create new! Then you can SEA.secret( share their email with some admin account you run. Usernames are not secure cause there is no centralized enforcement of who owns the username, this is p2p/offline/local-first remember!
@ruslanjan 3 years ago @robertheessels built a full text search demo, but it probably would need to be rebuilt - you up for that? Its fun! :clap: @rococtz:matrix.org Bunch of phonetic word vector indices! I'll screencall and help work you thru it.
@GiuseppeLantieri :clap: @lmangani:matrix.org . Maybe try to redeploy? (If you can tell me the crash error, that'd help)
@yokowasis yo @mmalmi <-- Iris-lib Q for you!
@rococtz:matrix.org AXE screencall today work for you?
Mark Nadal
@amark
@cryptoboid can you update the docs section with this info? https://github.com/amark/gun/wiki/Svelte
1 reply
mochic
@mochic
New to gunjs just curious if there's an easy workflow for being able to get the latest record from a set
Mark Nadal
@amark
@mochic :wave: !! If you want to get latest value, probably want .put( instead. If you want like the "last chat message in chat history" tho where you still need to use .set( then you could always have a special .get('chat').get('last').put(gunRefToLastSentMsg) property you index to and read from.
mochic
@mochic
@amark thanks for your quick response! trying to get a feed of latest active chats so it's not directly applicable but I can probably use your advice to try to figure out what I must be overlooking
Mark Nadal
@amark
@mochic :+1: cool, see if it works else instantly complain :) and we'll figure out something else that works.
rococtz
@rococtz:matrix.org
[m]
@amark: I had a look at the docs and code for AXE, but unfortunately it's beyond my abilities. It requires full time involvement and I am afraid it's not possible for me at this point. I am afraid I will have to limit myself to helping around in the chat and answer questions and continue to play with Gun as someone who consumes Gun for the moment
Mark Nadal
@amark
@rococtz:matrix.org awwe :) well thanks for being so amazing helping, it has made a big impact already! Honestly, helping/replying often takes more time than coding itself! So its very appreciated :)
Wasis Haryo Sasoko
@yokowasis

@amark regarding my PR on Github. I feel like the example/http.js is still the best way to quickly, and error-proof, deploy a relay server. I mean all you need to do is npm start. It's not about whether axe is bugged or not. But some people / company prefer, their relay is not becoming part of the AXE network.

That's my reason. Perhaps, while we're at it, it would be great to also to make the multicast port changeable via environment. It's always good to have more option.

Mark Nadal
@amark
@yokowasis excellent! Yes the PR is good idea just wanted to move the code into the appropriate self-contained adapter, and similarly for multicast in gun/lib/multicast. the http.js npm start calls those adapters, so don't fear, edits there to use env configs will be part of the default check.
Radu
@rococtz
@amark I have just created this indexed text search as an example for @ruslanjan
If you are happy with the code, I can update the AWESOME list in the wiki
https://codesandbox.io/s/react-playground-forked-lyn1g
1 reply
Mark Nadal
@amark
@rococtz woooooah!!! Yes please do.
wow that was so fast that you built it!
is it much harder to split on word (or n-grams) and index each word?
Screen Shot 2021-10-16 at 6.38.50 PM.png
^ I was wanting to find "cute Fox"
since * LEX is prefix based it correctly found fast cheetah
Radu
@rococtz
so you want to search for "f" and you want "cute fox" to appear?
that's only because I have no idea how to use LEX! :) Do you have an example of "includes" as opposed to "prefix"?
Mark Nadal
@amark
but if split each value['fast','cheetah'] and ['cute','fox'] indexed each word, then 'fox' would also show in the index too
Radu
@rococtz
oh right, good idea
I will try it now
Mark Nadal
@amark
LEX had a spec for "includes" in it but when I actually implemented it in RAD I tossed it out because it'd require non O(1) lookup time
and you know how important O(1) perf is to me
I argued we could create an "includes" operation later on top
by doing just this, then indexing the values as their own
and re-running LEX (the more limited version) on that
so while a little more work on top, it only needs to be done once as a framework, and then we get for free all the same O(1) perf that the system forces.
Wasis Haryo Sasoko
@yokowasis
image.png
any idea why this happened ?
Radu
@rococtz
yes
Mark Nadal
@amark
because now the N results are pre-indexed as a single 1 container.
Radu
@rococtz
because you typed "l", it found "lima" and then it didn't find anything else and it stayed with that filter
Mark Nadal
@amark
@yokowasis yeah the filter doesn't seem to clear thats why, which is fine for... a prototype built in like literally 10min WOW
BRB jumping on a call
amazing demo so fast!
Wasis Haryo Sasoko
@yokowasis
@rococtz , interesting. Thanks for demo for the lex. Have been looking for this.
Radu
@rococtz
I am trying to polish it up a bit
Wasis Haryo Sasoko
@yokowasis
@rococtz any reason why you choose open instead of map ?
Radu
@rococtz
well, open retrieves the whole list in one go and it goes down the path to retrieve the entire object info
but really, it doesn't matter, you can use whatever you like, it's just an example
Wasis Haryo Sasoko
@yokowasis
I just hate the warning of the open cluttered the console
Radu
@rococtz
true, true
Radu
@rococtz
@amark when you use this kind of code and there are no matches, shouldn't .open get called with no results? In my case, it doesn't get called at all:
 gun
        .get("myAnimalsTextIndex")
        .get({ ".": { "*": e.target.value } })
       .open(cb)
Radu
@rococtz
@amark @yokowasis I updated the code, what about now? It can search by word parts and it also clears:
https://codesandbox.io/s/react-playground-forked-631nt
gun_filter.gif