Having issues with EasySearch functionality; it was functioning correctly previously

Using Meteor has completely transformed my web development experience. Javascript has become incredibly fun for me.

I recently integrated the EasySearch solution on my site, but unfortunately it seems to have stopped working. It was functioning perfectly before.

Click here to visit the EasySearch repository on Github

During this time, I mainly focused on implementing Collectionsfs and made some changes to the field settings for data.

Snippet of Template code:

    <div class="container">
        {{> esInput index="posts" id="search" placeholder="Search Listing..." convertnumber=true }}
    </div>

     {{#ifEsIsSearching index="posts" id="search" logic="OR" }}
        <div>Searching...</div>
    {{/ifEsIsSearching}}

    {{#ifEsInputIsEmpty index="posts" id="search"}}
          <div class="posts">
            {{#each posts}}
              {{> postItem}}
            {{/each}}
          </div>

          {{else}}

          <div class="posts">
            {{#esEach index="posts" id="search"}}
                {{> postItem}}
            {{/esEach}}
          </div>
    {{/ifEsInputIsEmpty}}


    {{#ifEsHasNoResults index="posts" id="search" logic="OR" }}
        <div class="no-results">No results found!</div>
    {{/ifEsHasNoResults}}

</template>

Mongodb snippet:

Posts = new Mongo.Collection('posts');

Posts.initEasySearch(['firstName', 'lastName', 'university'], {
    'limit' : 20,
    'use' : 'mongo-db'
});


Posts.allow({
  update: function(userId, post) { return ownsDocument(userId, post); },
  remove: function(userId, post) { return ownsDocument(userId, post); },
});

Meteor.methods({
  postInsert2: function(postAttributes) {
    check(Meteor.userId(), String);
    check(postAttributes, {
      firstName: String,
      lastName: String,
      address: String,
      phone: String,
      university: String,
      loanPeriod: String,
      loanRate: String,
      loanAmount: String,
      job: String
    });
...........

Answer №1

Consider including matteodem:[email protected] in your list of packages. The new version of Easy Search no longer supports the old structure. Alternatively, you can follow this link to transition to the latest version:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to calculate the frequency of a specific word in an array?

I have been attempting to eliminate duplicates from my array and determine the frequency of each word appearing in the array. While I have come across methods to address this issue, none of them seem to be working. For instance, when I input the text "this ...

Establishing a connection between TypeScript and MongoDB

Whenever I try to add the mongo connection to the request, I encounter an error. The error message says: 'Property 'dbClient' does not exist on type 'Request<ParamsDictionary>'. I want the connection to be accessible witho ...

The concept of global object/scope and circular references in undefined cases

Trying to make sense of the outcomes from these few experiments : Experiment number 1 (in a new command line) : > _ ReferenceError: _ is not defined at repl:1:2 at REPLServer.self.eval (repl.js:110:21) at Interface.<anonymous> (repl. ...

Issue: Please avoid using HTML tag <img>. Instead, utilize the Image component from 'next/image' - Next.js when working with styled components

While working with Next.js, I encountered an issue with the Image component. Unlike a regular HTML tag, the Image component requires a layout and doesn't offer the same level of control. Additionally, I found that it couldn't be used with framer ...

Creating a clickable button within an image container using Bootstrap 5

I am attempting to create a button inside an img element, specifically in the center of that img element within Bootstrap 5. The image is not being used as a background on the grid and I am applying some hover animations to zoom in. I am curious if there ...

What is the process for executing mocha tests within a web browser?

Am I the only one who thinks that their documentation lacks proper instructions on running tests in the browser? Do I really need to create the HTML file they mention in the example? How can I ensure that it runs the specific test cases for my project? I ...

Need to return to the previous page following submission

Is there a way to redirect me to the premontessori page after I submit the form? Below is my function handleSubmit: handleSubmit(event) { event.preventDefault(); <Link to='/premontessori' style={{textDecoration:'none'}} & ...

Developing a Customized Styling Guide Using Node.JS and User Specifications

Seeking a method to generate a personalized user style sheet utilizing input from users. Users can choose options like background colors, and the app will generate a custom style sheet based on their selections. Their input will be captured through HTML in ...

How to reorganize or transfer a value within a field in a Mongodb collection?

I have a set of tasks with varying priorities that I manage. I am looking for a way to efficiently insert a new task with a specific priority or change the priority of an existing task, while ensuring that all other priorities are adjusted accordingly. Cu ...

How to handle JSON parsing in a sails.js controller with node.js

Within my MapController, I have created a function to parse remote JSON files and populate an array called "parsewebservice" through an if-else structure. While everything seems to be working fine, the issue arises when trying to log the values of parseweb ...

Adjust the orientation of a Three.js-generated 3D "Cube" to create a new view

I've managed to create a 3D wire-frame cube using Three.js examples, but I'm looking to adjust the cube's angle. Currently, it appears like this: However, I want it to resemble this: Take a look at my code: HTML <script src="http://w ...

"The ng-route feature is not working as expected; instead of displaying the template url, it is showing

I'm currently developing a voting application as part of my freecodecamp project using the MEAN stack. I have completed the backend portion, but without user authentication for now. My focus now is on the frontend. I have created an HTML page that li ...

Generate an array of image categories from an array of image objects

I have an array of Objects that looks like this: $scope.images = [ {key: 'shop1/images/a1.jpg'}, {key: 'shop2/images/a2.jpg'}, {key: 'shop1/images/a3.jpg'}, {key: 'shop3/images/a4.jpg'} ...

Why isn't the program recording user input in the console when the form is submitted?

Can someone please advise me on how to get the program to print the user's input values to the console when they click the "Sign up now" button? ...

My Node setup is not displaying my scene with the THREE.js Software Renderer

Struggling to incorporate 3d graphics into Node.js environment, I stumbled upon the Software Renderer after exhaustive research. The renderer is up and running, but I am facing difficulties in rendering my scene. The issue lies in the fact that my 3d obje ...

I have successfully implemented an onChange function with its corresponding set of parameters. However, I now desire to extend its functionality by incorporating

I have an onchange function that triggers when the "pending" option is selected in a select dropdown menu. This function adds a predefined value to an input field. However, I also want this functionality to apply when the page loads. Currently, the "pendin ...

Obtaining data using PHP and transferring it to a JavaScript variable

Currently, I am in the process of developing an audio player for a project that I am working on. I have this weird idea - is it feasible to retrieve a URL or any data from my MySQL table and then assign it to a JavaScript variable? If it is possible, cou ...

The Power of Asynchronous Programming with Node.js and Typescript's Async

I need to obtain an authentication token from an API and then save that token for use in future API calls. This code snippet is used to fetch the token: const getToken = async (): Promise<string | void> => { const response = await fetch(&apos ...

Discovering closest neighbors using MongoDB

I'm working on a project to set up a basic leaderboard using MongoDB. I've developed an API with Node.js and Express. Currently, I have a JSON data structure sorted by user points that looks like this: [ { "_id": "58e543758222ff220d0af4 ...

Is the element loaded but not appearing on screen?

I am facing an issue when using ajax to send data to a PHP server and displaying it in the view. Even though the data loads successfully (checked in console), it does not display in the view. Can someone please help me resolve this? Here is my code : Vie ...