Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    jean-baptiste demonte
    @jbdemonte
    Hi, FYI, I needed a few things (promises, typeKey support...) which required a lot of code refactoring, after a few hours (especially with typeKey), I decided to start a mongoosastic like plugin
    It is available on https://www.npmjs.com/package/mongoose-elasticsearch-xp
    Eduardo Niemeyer
    @edniemeyer
    hey there! i'm trying mongoosastic but i can't make it unindex from elasticsearch when using delete
    i've tryed this: doc.remove(function(err) {
    if (err) throw err;
    / Document unindexing in the background /
    doc.on('es-removed', function(err, res) {
    if (err) throw err;
    / Docuemnt is unindexed /
    });
    });
    doc.on is not a function
    at Immediate.<anonymous> (c:\Users\Eduardo\discsCatalog\routes\index.js:75:14)
    at Immediate._onImmediate (c:\Users\Eduardo\discsCatalog\node_modules\mongoose\node_modules\mquery\lib\utils.js:137:16)
    at processImmediate [as _immediateCallback] (timers.js:383:17)
    Eduardo Niemeyer
    @edniemeyer
    it is saying "on" is not a function, but it does work when i do the save part :/
    Eduardo Niemeyer
    @edniemeyer
    No worries! Now I could make it work :)
    Matt Huijsse
    @mistamadd001
    hey guys, quick noob question is this the right way to create a one option required???
        phone: {
            mobile: Number,
            home: Number,
            work: Number,
            required: true
        },
    Maksim
    @chetverikov
    Required: { type: Boolean }
    Matt Huijsse
    @mistamadd001
    @chetverikov thanks for your answer, but that is not the question I asked, I have now figured it out, I needed to make an embedded schema to manage the phones.
    Matt Huijsse
    @mistamadd001
    anyone know why im getting a 500 error when trying to PUT my phone numbers into my nested schema?
    Quentin Hayot
    @quentinhayot

    Hi guys !
    I'm trying to filter against a geo_point (geo_coordinates) which is nested in an object (Location), which is nested in an array in the queried object (MyObject).
    The problem is that the mapping for the object MyObject does not see the geo_coordinates field as a geo_point:

    // Index mapping for object MyObject
    "myobjects": {
        "mappings": {
          "myobject": {
            "properties": {
                "locations": {
                "type": "nested",
                "include_in_parent": true,
                "properties": {
                    "geo_coordinates": {
                    "properties": {
                      "lat": {  "type": "double" },
                      "lon": { "type": "double" }
                    }
                  },
      }
    [...]
    // Index mapping for object Location 
    "locations": {
        "mappings": {
          "location": {
            "properties": {
              "geo_coordinates": {
                "type": "geo_point"
              },
            }
          }
        }

    The object A looks like this:

    var MyObjectSchema = new Schema(
    [...]
        locations: {
          type: [{ type: Schema.Types.ObjectId, ref: 'Location', es_schema: LocationSchema.schema}],
          es_type: 'nested',
          es_include_in_parent: true
        },
    [...]
    )

    The object Location looks like this:

    var LocationSchema = new Schema(
    [...]
      geo_coordinates: {
          type: {
            geo_point: {
              type: String,
              es_type: 'geo_point',
              es_lat_lon: true
            },
    
            lat: {type: Number, default: 0},
            lon: {type: Number, default: 0}
          },
          es_type: 'geo_point'
      }
    [...]
    );

    My query looks like this:

    // POST http://ES-endpoint/locations/_search
    {
        "query": {
            "filtered" : {
                "query": {
                        "match_all" : {}
                    },
                    "filter" : {
                        "geo_distance" : {
                            "distance" : "20000km",
                            "locations.geo_coordinates" : {
                                "lat" : 40,
                                "lon" : -70
                            } }  }  } }}

    I must miss something, but what ? :(
    PS: When exploring the indexes with Kibana, both objects have the same data for geo_location:

    "geo_coordinates": {
              "lat": x.xxxx,
              "lon": y.yyy
            }
    Aravind Suresh
    @aaravinds_twitter
    hi can someone suggest me the best mongoose auto increment library
    web-surfer
    @web-surfer
    This message was deleted

    I have this search query:

                        Movie.search({
                            query: {
                                query_string: {
                                    fields: ["movieName"],
                                    default_operator: "AND",
                                    query: searchInput
                                }
                            }
                        }

    How do I add a synonym filter to this?

    tam.dang
    @danghatam
    Hi @all
    i use esTruncate method to delete all documents. But it seems only delete some documents (not all) on calling.
    BuildingModel.esTruncate(err => {
              if (err) console.log(err);
              BuildingModel.synchronize();
            });
    shenkev
    @shenkev
    This message was deleted

    Hi guys, if I specify to populate a model using Mongoosastic, what is the behavior?

    User.plugin(mongoosastic, {
    populate: [
    {path: 'comments', select: 'title body'}
    ]
    })

    When I perform a search, does "comments" first get populated, then the search occurs? Therefore, will the search consider strings inside User.comments._somefield?

    himanshuoodles
    @himanshuoodles
    domain.ECommerceProducts.search(
    {
    "aggs" : {
    "productAttributes" : {
    "terms" : {
    "field" : "productBrand",
    "size" : 0
    }
    }
    }
    }
    ,function(err,results){
    nested: QueryParsingException[[ecommerceproductss] No query registered for [aggs]];
    himanshuoodles
    @himanshuoodles
    guys can any body solve this?
    DIfyzz
    @ifiokidiang_twitter
    Hi everyone
    Good day
    I've been having an issue with syncing updates in mongoosastic
    It is exactly as described here:
    Balaji R
    @sch00lb0y
    Hi guys I'm getting timeout error can anyone help me with this??
    Elastic server is up and running
    David Novicki
    @supercycle91

    Does anyone know how to implement mongoosastic in keystonejs? I am getting an error in mongoosastic when trying to populate. KeystoneJS wraps mongoose schema and not sure the needed mongoose functions are there. Any insight would be awesome

    category: {
                type: Types.Relationship,
                ref: 'ProductCategory',
                index: true,
                many: true,
                es_schema: ProductCategory,
                es_indexed: true,
                es_type: 'nested',
                es_include_in_parent: true
            },

    Error in mongoose library happens in this function

      function postSave (doc) {
        let _doc
        function onIndex (err, res) {
          if (!filter || !filter(doc)) {
            doc.emit('es-indexed', err, res)
          } else {
            doc.emit('es-filtered', err, res)
          }
        }
    
        if (doc) {
          _doc = new doc.constructor(doc)
          if (populate && populate.length) {
            populate.forEach(populateOpts => {
              _doc.populate(populateOpts)
            })
            _doc.execPopulate().then(popDoc => { //error happening here
              popDoc.index(onIndex)
            }).catch(onIndex)
          } else {
            _doc.index(onIndex)
          }
        }
      }
    Product.schema.plugin(mongoosastic, {
        hosts: [
            'host here'
        ], 
        populate: [
            {path: 'category'}
        ]
    })

    error

    Meher Chandan
    @meherchandan
    Hi all..
    I am new in mongoosastic and need a little help.
    I have to two schemas..User and Post.. each post has a reference to User with author field.
    Now I want to hydrate the author(all details available in User for that objectID) on requesting Post..
    It's always giving me objectID and not the actual data.
    jean-baptiste demonte
    @jbdemonte
    Philip
    @balasphilip
    hi all, does anyone know how to index simple nested objects? Examples from here: https://www.npmjs.com/package/mongoosastic#indexing-nested-models and here: https://www.npmjs.com/package/mongoosastic#elasticsearch-nested-datatype didn't help me. As I correctly understand this is open issue: mongoosastic/mongoosastic#136
    After saving in elastic I can't search by reporter's name/email fields.
    const caseSchema = new Schema({
        title: { type: String, required: true, es_indexed: true },
        description: { type: String, required: true, es_indexed: true },
        tags: [{ type: String, es_indexed: true }],
        reporter: {
            // need to index this nested structure
            name: { type: String, required: true },
            email: { type: String, required: true }
        }
    });
    
    caseSchema.plugin(mongoosastic, {
        esClient: esClient,
        hydrate: true,
        hydrateOptions: { lean: true }
    });
    Philip
    @balasphilip
    Also I tried to use this method https://www.npmjs.com/package/mongoosastic#indexing-mongoose-references
    After data saved inside elastic I see smth like this http://prntscr.com/esssp1, but I can't search by reporter, too
    Alexis A. Banaag Jr.
    @aabanaag
    any ideas, I got this error
     Uncaught TypeError: _doc.index is not a function
          at Query.postSave (node_modules/mongoosastic/lib/mongoosastic.js:260:14)
          at next (node_modules/kareem/index.js:182:14)
    this happens when I try to update record.
    Alexis A. Banaag Jr.
    @aabanaag
    hi, we are using mongoosastic but upon checking our server we noticed that there are loads of open connection for Elasticsearch. Is it safe to assume that mongoosastic is causing this? if it is is there a way to limit or handle this?
    Javier Richard Cuicapuza Antonio
    @Cuica20
    Hi all :)
    Manoj Kumar
    @manojsb
    Hi
    Anyone here
    Maksim
    @chetverikov
    Hi
    Manoj Kumar
    @manojsb
    image.png
    Mohamed Abd El Raouf
    @mohamedraouf_1_twitter
    Hi All,
    I just want to ask if there is anyway to check indexing status?
    ManAnRuck
    @ManAnRuck
    Hi! Is there a way to get the top recent search terms?
    Gustavo
    @guumaster
    @/all I'm pleased to announce that we have a new version with all its deps updated and the tests are passing again.
    Zamiul Hasan
    @zhfahan77
    @guumaster is this repo still active?