Full text search



  • I am able to get result from my full text search operation

    i am adding my code please tell me the problem and the possible solution

    @
    QJsonObject query;
    QJsonArray objectTypes;
    objectTypes.append(QString::fromUtf8("objects.category"));
    query["objectTypes"]=objectTypes;
    QJsonObject wordObject;

    wordObject["phrase"]=checkbox->text().toLower();//+QString(" AND ")+QString("New Delhi");
    QJsonArray properties;
    properties.append(QString::fromUtf8("name"));
    wordObject["properties"]=properties;
    
    query["search"]=wordObject;
    qDebug()<<"Search done: "<<query;
    EnginioReply *r=client->fullTextSearch(query);
    
    QObject::connect(r,&EnginioReply::finished,[](EnginioReply *r)
    {
        QJsonArray result=r->data()["results"].toArray();
        qDebug()<<r->data();
        foreach(const QJsonValue &value,result)
        {
            const QJsonObject &obj=value.toObject();
            const QString &fileId=obj.value("file").toObject().value("id").toString();
            qDebug()<<fileId;
    
        }
    });
    

    @
    The result to this is coming null
    @
    QJsonObject({"query": {"maxScore": null,"objectTypes": null,"total": 0},"results": []})
    @



  • Have you indexed the property (name) you're querying into ? Full text search only searches indexed properties, and searches all indexed properties by default.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.