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

Document working with text indexes #2051

Open
alcaeus opened this issue Aug 20, 2019 · 4 comments
Open

Document working with text indexes #2051

alcaeus opened this issue Aug 20, 2019 · 4 comments
Labels
Documentation Easy Pick Hacktoberfest Good issue for participating in Hacktoberfest
Projects

Comments

@alcaeus
Copy link
Member

alcaeus commented Aug 20, 2019

Feature Request

Q A
New Feature no
RFC no
BC Break no

Summary

The index section in the docs does not contain any information on how to work with text indexes. While the query builder docs have a section on text search (see https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/1.2/reference/query-builder-api.html#text-search), it would be beneficial to also document creating text indexes along with the various options that are possible for them.

@alcaeus alcaeus added this to 2.1 in Roadmap Sep 13, 2019
@jmikola jmikola self-assigned this Sep 13, 2019
@alcaeus alcaeus added this to To do in ODM 2.1 via automation Oct 8, 2019
@alcaeus alcaeus moved this from 2.1 to 2.2 in Roadmap May 19, 2020
@alcaeus alcaeus removed this from To do in ODM 2.1 May 19, 2020
@malarzm
Copy link
Member

malarzm commented May 24, 2020

@shubaivan
Copy link

shubaivan commented Aug 5, 2020

@alcaeus I faced with error about language. I use db version v4.4.0

I added index to my collection

/**
 * @MongoDB\Document(repositoryClass=AwinProductRepository::class)
 * @MongoDB\Index(keys={"product_name"="text"})
 */
class AwinProduct extends AbstractDocument
{
    /**
     * @MongoDB\Field(type="string")
     */
    protected $aw_deep_link;

    /**
     * @MongoDB\Field(type="string")
     */
    protected $product_name;

and then try to update schema

/var/www/symfony # php bin/console doctrine:mongodb:schema:update
Index build failed: 201968ff-ee54-456e-afc1-6ed742906343: Collection symfony.AwinProduct ( 71eb1888-9850-4799-889b-2d5908bcab46 ) :: caused by :: language override unsupported: 
/var/www/symfony # 

in native query I faced with the same problem

db.getCollection('AwinProduct').createIndex( { product_name: "text", aw_product_id: "text" } )

Index build failed: 024ff5ce-07fc-493f-be0f-bc21b8c28cfe: Collection symfony.AwinProduct ( 71eb1888-9850-4799-889b-2d5908bcab46 ) :: caused by :: language override unsupported:

hm, some advice ?

@alcaeus alcaeus moved this from 2.2 to 2.x in Roadmap Jan 12, 2021
@alcaeus alcaeus added Easy Pick Hacktoberfest Good issue for participating in Hacktoberfest labels Jan 12, 2021
@nixilla
Copy link

nixilla commented Dec 10, 2021

This just popped up on SO: https://stackoverflow.com/questions/61933036/error-text-index-required-for-text-query

I've answered this question on SO, if you still need it.

@malarzm
Copy link
Member

malarzm commented Dec 10, 2021

@nixilla cool! Would you mind contributing to our documentation as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Easy Pick Hacktoberfest Good issue for participating in Hacktoberfest
Projects
No open projects
Roadmap
2.x (future scope)
Development

No branches or pull requests

5 participants