Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the words number of matches (nb_matches) in the search range not in all Quran #534

Open
iTarek opened this issue Jul 7, 2021 · 2 comments

Comments

@iTarek
Copy link

iTarek commented Jul 7, 2021

When search with two words like آدم + وزوجك
The results are 2 ayah from Al Bakrah sura
The total words matches in the search range is 4, two in each ayah

[ وَيَا آدَمُ اسْكُنْ أَنْتَ وَزَوْجُكَ الْجَنَّةَ فَكُلَا مِنْ حَيْثُ شِئْتُمَا وَلَا تَقْرَبَا هَذِهِ الشَّجَرَةَ فَتَكُونَا مِنَ الظَّالِمِينَ ]

[ وَقُلْنَا يَا آدَمُ اسْكُنْ أَنْتَ وَزَوْجُكَ الْجَنَّةَ وَكُلَا مِنْهَا رَغَدًا حَيْثُ شِئْتُمَا وَلَا تَقْرَبَا هَذِهِ الشَّجَرَةَ فَتَكُونَا مِنَ الظَّالِمِينَ ]

I get in the API "nb_matches": 22
And I can not find any number representing the nb_matches in that search range, I can not get the number that representing the words you highlight.

This is important, Why? because when you search for word like رحمة in one sura and try to compare it with another word like عذاب in the same sura, you get the number of matches from the all Quran and you have to count the words yourself in the search range witch is one sura to get the match number in your search range.

And there are many examples how this is so important.

      },
      "words":{
         "global": {
        "nb_vocalizations": 3,
        "nb_matches": 22,
        "nb_words": 2
      },
      "interval":{
         "page":1,
         "end":2,
         "nb_pages":1,
         "total":2,
         "start":1
      }

Thank you and I wish there is already a way to get the nb_matches for words that you already highlight on my search range not in all Quran.

@iTarek
Copy link
Author

iTarek commented Jul 7, 2021

I suggest you add "nb_matches_search": in the "individual": for each word, this number tell the number of matches on the search scope.

  "words": {
      "individual": {
        "1": {
          "derivations_extra": [],
          "romanization": null,
          "nb_derivations_extra": 0,
          "nb_synonyms": 0,
          "synonyms": [],
          "nb_matches": 2,
          "lemma": null,
          "vocalizations": [
            "وَزَوْجُكَ"
          ],
          "nb_ayas": 2,
          "nb_vocalizations": 1,
          "nb_derivations": 0,
          "root": null,
          "word": "وزوجك",
          "derivations": []
        },
        "2": {
          "derivations_extra": [],
          "romanization": null,
          "nb_derivations_extra": 0,
          "nb_synonyms": 0,
          "synonyms": [],
          "nb_matches": 20,
          "lemma": "آدم",
          "vocalizations": [
            "آدَمَ",
            "آدَمُ"
          ],
          "nb_ayas": 20,
          "nb_vocalizations": 2,
          "nb_derivations": 2,
          "root": "آدم",
          "word": "آدم",
          "derivations": [
            "لآدم",
            "آدم"
          ]
        }

also on the

    "words":{
         "global": {

you add the same value for the sum of "nb_matches_search": in all words

@ghost
Copy link

ghost commented Jul 7, 2021

I prefer to solve the facets all the same way, I will give it a shot in the weekend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants