GithubHelp home page GithubHelp logo

NotesCollection FTSearch about domino-jna HOT 7 CLOSED

klehmann avatar klehmann commented on September 15, 2024
NotesCollection FTSearch

from domino-jna.

Comments (7)

klehmann avatar klehmann commented on September 15, 2024

Hi!

I did not get 0 entries as result when I just tried this with an empty EnumSet of FTSearch flags, but my search results did not appear in view order. Will need to do some tests to see how to change this and whether NUMDOCS_ONLY does not work as expected.

But I just created a (complicated) test case that does want you are searching for by running a FT search on the database, but restricted to the note ids contained in the view, and then reads the view data for the search matches in view order:
https://github.com/klehmann/domino-jna/blob/master/domino-jna/src/test/java/com/mindoo/domino/jna/test/TestViewTraversalWithFTSearch.java

Hope this helps. Will get back to you when I have more info

from domino-jna.

klehmann avatar klehmann commented on September 15, 2024

I just added a second testcase to the class TestViewTraversalWithFTSearch that runs the FT search against the view index.
Looks like in this mode, results are either sorted by score, creation date or modified date.

So if you want custom sorting, I would recommend using the view selection as it is done in the first testcase.

from domino-jna.

oshmianski avatar oshmianski commented on September 15, 2024

Hi!

Thank you very match! The first example works perfectly.

But I'm a little surprised. The implementation is very different from the standard paradigm. This is unusual and some tricks are not obvious. Many undocumented functions are used.

I wrote a small web application for reading various domino views. I used your library in it (version 0.44.0). Back-end is Open Source. You might be interested in looking at the implementation. It would be nice to hear your opinion.

Regards

from domino-jna.

klehmann avatar klehmann commented on September 15, 2024

Looks good. One thing:

NotesDatabase dbData = new NotesDatabase(db.getServer(), db.getFilePath(), (String) null);

This opens the database as the server, not as the user. So if you are using reader fields in the documents, you might get unexpected results.
So either replace the null value with the username (canonical or abbreviated) or use the constructor that takes a lotus.domino.Session (the constructor then internally reads session.getEffectiveUsername()).

from domino-jna.

oshmianski avatar oshmianski commented on September 15, 2024

Thanks.

Reading on behalf of the server was originally conceived (the craft is called so AdminReaders) :-))

I did not find how to get the current database (like legacy NotesSession.currentDatabase)?

Regards

from domino-jna.

klehmann avatar klehmann commented on September 15, 2024

Since the API can also be used in standalone applications, there is no current database property yet, but I could probably add callbacks to get the current context (database/user) and implement them for the XPages environment to derive them from the HTTP request URL.

There already is IDUtils.setEffectiveUsername(), which stores the username for the current NotesGC block (for XPages = the current HTTP request), but I am not totally have with it. Just needed a place to store the user in my own apps.
It's possible that I refactor this and you need to change your code a bit on update. My current goal is to put as much functionality as possible into the API so that Notes.jar is not required anymore.

from domino-jna.

oshmianski avatar oshmianski commented on September 15, 2024

There already is IDUtils.setEffectiveUsername(), which stores the username for the current NotesGC block (for XPages = the current HTTP request), but I am not totally have with it.

In my opinion, that is enough.
The Sсope strategy is quite slippery, it seems to me.

from domino-jna.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.