Titanium JIRA Archive
Appcelerator Community (AC)

[AC-4045] The "$text" operator in query in ArrowDB (created in April 2015) not working

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionHold
Resolution Date2016-08-29T17:13:12.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsArrowDB
Labelsn/a
ReporterParijat sahai
AssigneeShak Hossain
Created2016-07-11T13:27:38.000+0000
Updated2016-08-29T17:13:12.000+0000

Description

Please let me know how to make the $text operator in query in ArrowDB to work.

Comments

  1. Aminul Islam 2016-07-11

    Hello, Thanks for reach out. Would you mind if i request more details about your problem? We are not clear your problems. If you add more details then it's easy to solve your problem. Please let us know we are waiting your valuable response. Thanks
  2. Parijat sahai 2016-07-11

    What specific details would you like to know? I'm referring to the "$text" operator in the ArrowDB query. Please refer to the following documentation: http://docs.appcelerator.com/arrowdb/latest/#!/guide/search_query-section-where $text Perform a text search on the contents of the field. A $text expression has the following syntax: { "$text": { "$search": }} Most punctuation marks and spaces are treated as delimiters allowing you to search for multiple keywords, excluding escaped double quotes (\") and hypens (-). Escaped double quotes are used for phrase searches and hyphens are used to negate searches. Sorting does not work with the $text operator, that is, using the order field will have no effect when using the $text operator. The documentation also says the following: The search API is deprecated since Release 1.3.0. Applications created before Arrow Cloud Release 1.3.0 can continue to use the deprecated search API, but new applications will need to use the query API with the $text query operator. Now, I suspect that my ArrowDB was created before Arrow Cloud Release 1.3.0 but I'm not too sure of that. That said, I'd like to use the $text query operator on my Arrow Model (in the Arrow Project). Is that not possible? Do I have to specifically use query on "Custom Objects" - will it work that way?
  3. Mostafizur Rahman 2016-07-11

    Hi Parijat, I discussed your issue with engineering team and you can use $text operator after creating tags. Please let us know your Arrow Cloud Release version. For being up to date, we encourage you to upgrade your app to latest version of Arrow Cloud. It is easy to migrate to latest version of Arrow Cloud. Please check our migration guide Regards Nur Rony
  4. Parijat sahai 2016-07-11

    How do I check my app's Arrow Cloud version? So are you saying that usage of the $text operator has nothing to do with the ArrowDB version or ArrowDB SDK version? Also, could you please elaborate on the "creating tags" part? Please note that I'm trying to use it on an Arrow Model. How do I create tags?
  5. Parijat sahai 2016-07-11

    MongoDB documentation has the following: Use the $meta query operator to obtain and sort by the relevance score of each matching document. For example, to order a list of coffee shops in order of relevance, run the following:
       db.stores.find(
          { $text: { $search: "coffee shop cake" } },
          { score: { $meta: "textScore" } }
       ).sort( { score: { $meta: "textScore" } } )
       
    Can I do the same on my Arrow Models with the $text operator?
  6. Parijat sahai 2016-07-11

    I just tested the "tags" and it does work but not quite the way I imagined it. It requires me to define precise tags that can be searched. So if I want to search for "home", then having a tag called "myhome" doesn't return anything but a tag called "home" returns the object. This isn't good as I want a partial text search which the Appcelerator documentation says it can do. Hence, using tags isn't a correct solution here. I assume that ArrowDB is based on MongoDB as a lot of syntax for queries is more or less identical in both. Please let me know if ArrowDB has a feature similar to the following:
       You can index multiple fields for the text index. The following example creates a text index on the fields subject and comments:
       db.reviews.createIndex(
          {
            subject: "text",
            comments: "text"
          }
        )
       
    Please look at [https://docs.mongodb.com/manual/core/index-text/] and [https://docs.mongodb.com/manual/text-search/] to see what I'm referring to.

JSON Source